zt-react-milkdown 0.1.7 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/index.cjs +88 -36
- package/dist/index.mjs +24647 -4893
- package/dist/src/core/createEditor.d.ts +44 -3
- package/dist/src/core/createEditor.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/plugins/custom/block-transform/block-transform.d.ts.map +1 -1
- package/dist/src/plugins/custom/code-block/code-block-language-picker.d.ts.map +1 -1
- package/dist/src/plugins/custom/image/image-resizable-schema.d.ts.map +1 -1
- package/dist/src/plugins/custom/image/image-upload-dialog/index.d.ts.map +1 -1
- package/dist/src/plugins/custom/selection-tooltip/index.d.ts.map +1 -1
- package/dist/src/plugins/custom/selection-tooltip/tooltip-view.d.ts +2 -0
- package/dist/src/plugins/custom/selection-tooltip/tooltip-view.d.ts.map +1 -1
- package/dist/src/plugins/custom/selection-tooltip/types.d.ts +2 -0
- package/dist/src/plugins/custom/selection-tooltip/types.d.ts.map +1 -1
- package/dist/src/plugins/custom/slash-menu/slash-menu-commands.d.ts.map +1 -1
- package/dist/src/plugins/custom/slash-menu/slash-menu.d.ts +1 -1
- package/dist/src/plugins/custom/slash-menu/slash-menu.d.ts.map +1 -1
- package/dist/src/plugins/custom/table/table-focus-actions.d.ts.map +1 -1
- package/dist/src/plugins/custom/table/table-more-actions.d.ts +2 -0
- package/dist/src/plugins/custom/table/table-more-actions.d.ts.map +1 -1
- package/dist/src/react/components/MilkdownEditor.d.ts.map +1 -1
- package/dist/src/react/hooks/useMilkdownEditor.d.ts +3 -3
- package/dist/src/react/hooks/useMilkdownEditor.d.ts.map +1 -1
- package/dist/src/types/editor.d.ts +0 -34
- package/dist/src/types/editor.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/commands-BJpevWrH.js +0 -409
- package/dist/commands-BmZHd6RL.js +0 -2
- package/dist/commands-CM7IuhpT.cjs +0 -2
- package/dist/commands-f4yOm8DQ.cjs +0 -1
- package/dist/debounce-C_TNzOFT.cjs +0 -1
- package/dist/debounce-Z8-khnlZ.js +0 -118
- package/dist/dist-BjfIurm0.js +0 -1584
- package/dist/dist-CLTsQjPD.js +0 -3500
- package/dist/dist-D7LE16E1.cjs +0 -1
- package/dist/dist-DQnWlYyo.cjs +0 -5
- package/dist/floating-ui.dom-B_oXwL6O.cjs +0 -1
- package/dist/floating-ui.dom-Cm9Ov61_.js +0 -883
- package/dist/lib-5lx86j_L.js +0 -21
- package/dist/lib-72N1aRae.js +0 -1884
- package/dist/lib-BIxqp3lX.js +0 -387
- package/dist/lib-BLTQkf4j.cjs +0 -39
- package/dist/lib-BzlEyehQ.cjs +0 -5
- package/dist/lib-C61-3fwS.cjs +0 -1
- package/dist/lib-C82poHMJ.cjs +0 -1
- package/dist/lib-CDhjYvDm.js +0 -74
- package/dist/lib-CHQUpMrL.cjs +0 -3
- package/dist/lib-CYWwNE4c.js +0 -8673
- package/dist/lib-Cixz93sP.js +0 -2222
- package/dist/lib-CqJFV3ME.cjs +0 -1
- package/dist/lib-D7VWCO2M.cjs +0 -4
- package/dist/lib-DaPs62nF.js +0 -28
- package/dist/lib-Dka_BhhQ.cjs +0 -1
- package/dist/lib-DrllUeuK.cjs +0 -1
- package/dist/lib-wpjVX5Vf.js +0 -80
- package/dist/lib-z6CKD87x.js +0 -331
- package/dist/schema-list-CFEw5DQ8.cjs +0 -1
- package/dist/schema-list-CiFfAlj-.js +0 -110
- package/dist/src/react/hooks/useCloseOnGlobalScroll.d.ts +0 -5
- package/dist/src/react/hooks/useCloseOnGlobalScroll.d.ts.map +0 -1
- package/dist/state-BC1dqWPQ.cjs +0 -1
- package/dist/state-BvRk9kiK.cjs +0 -0
- package/dist/state-BvRk9kiK.js +0 -0
- package/dist/state-rTW_1XVf.js +0 -3
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,61 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./lib-BLTQkf4j.cjs"),t=require("./dist-DQnWlYyo.cjs"),n=require("./commands-CM7IuhpT.cjs"),r=require("./lib-CqJFV3ME.cjs"),i=require("./schema-list-CFEw5DQ8.cjs"),a=require("./lib-CHQUpMrL.cjs"),o=require("./floating-ui.dom-B_oXwL6O.cjs"),s=require("./debounce-C_TNzOFT.cjs"),c=require("./dist-D7LE16E1.cjs");let l=require("react"),u=e.St(l,1);l=e.St(l);let d=require("react-dom/server"),f=require("react-dom/client"),p=require("react-dom");p=e.St(p,1);let m=require("react/jsx-runtime");function h(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=h(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function g(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=h(e))&&(r&&(r+=` `),r+=t);return r}var _=e=>typeof e==`string`?e:``,v=(e,t,n)=>{let r=typeof e==`string`,[i,a]=(0,u.useState)(_(t));return{markdown:(0,u.useMemo)(()=>r?_(e):i,[i,r,e]),setMarkdown:(0,u.useCallback)(e=>{r||a(e),n?.(e)},[r,n]),isControlled:r}};function y(e,t,{signal:n,edges:r}={}){let i,a=null,o=r!=null&&r.includes(`leading`),s=r==null||r.includes(`trailing`),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},l=()=>{s&&c(),p()},u=null,d=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,l()},t)},f=()=>{u!==null&&(clearTimeout(u),u=null)},p=()=>{f(),i=void 0,a=null},m=()=>{c()},h=function(...e){if(n?.aborted)return;i=this,a=e;let t=u==null;d(),o&&t&&c()};return h.schedule=d,h.cancel=p,h.flush=m,n?.addEventListener(`abort`,p,{once:!0}),h}var b=(e,t)=>typeof e==`function`?n=>{t.action(e(n))}:()=>void 0,x=(e,t,n)=>{if(Array.isArray(n)){n.forEach((n,r)=>{e.push({name:`${t}-${r}`,plugin:n})});return}e.push({name:t,plugin:n})},S=(e,t={})=>{let n=[],r=t.includeRuntime??!0;return x(n,`listener`,e.listener),x(n,`commonmark`,e.commonmark),x(n,`gfm`,e.gfm),x(n,`history`,e.history),x(n,`code-block-prism`,e.codeBlockPrism),x(n,`code-block-language-picker`,e.codeBlockLanguagePicker),r&&(x(n,`clipboard`,e.clipboard),x(n,`indent`,e.indent)),x(n,`image-delete-selection`,e.imageDeleteSelection),x(n,`table-arrow-entry`,e.tableArrowEntry),x(n,`math-backspace-entry`,e.mathBackspaceEntry),x(n,`blockquote-backspace-lift`,e.blockquoteBackspaceLift),x(n,`table-focus-actions`,e.tableFocusActions),x(n,`selection-tooltip`,e.selectionTooltip),x(n,`gap-cursor`,e.gapCursor),x(n,`drop-cursor`,e.dropCursor),x(n,`math`,e.math),x(n,`math-inline-edit`,e.mathInlineEdit),x(n,`math-inline-arrow-navigation`,e.mathInlineArrowNavigation),x(n,`task-list-toggle`,e.taskListToggle),x(n,`tab-space-indent`,e.tabSpaceIndent),x(n,`code-block-mod-a-select`,e.codeBlockModASelect),e.slash&&x(n,`slash`,e.slash),n},C=(e,t)=>{if(!(t in e))throw Error(`Milkdown API 缺少必需导出: ${t}`);return e[t]};function w(e={}){return new t.i({view(t){return new T(t,e)}})}var T=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,a=typeof i==`function`?i(this.editorView,n,e):i;if(n&&!a){let e=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let n=t._(this.editorView.state.doc,e,this.editorView.dragging.slice);n!=null&&(e=n)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},E=2,ee=`var(--zt-primary)`,te=r.u(()=>w({color:ee,width:E})),D=class e extends t.o{constructor(e){super(e,e)}map(n,r){let i=n.resolve(r.map(this.head));return e.valid(i)?new e(i):t.o.near(i)}content(){return t.A.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new ne(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!ie(e)||!ae(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(n,r,i=!1){search:for(;;){if(!i&&e.valid(n))return n;let a=n.pos,o=null;for(let t=n.depth;;t--){let i=n.node(t);if(r>0?n.indexAfter(t)<i.childCount:n.index(t)>0){o=i.child(r>0?n.indexAfter(t):n.index(t)-1);break}else if(t==0)return null;a+=r;let s=n.doc.resolve(a);if(e.valid(s))return s}for(;;){let s=r>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!t.r.isSelectable(o)){n=n.doc.resolve(a+o.nodeSize*r),i=!1;continue search}break}o=s,a+=r;let c=n.doc.resolve(a);if(e.valid(c))return c}return null}}};D.prototype.visible=!1,D.findFrom=D.findGapCursorFrom,t.o.jsonID(`gapcursor`,D);var ne=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return D.valid(n)?new D(n):t.o.near(n)}};function re(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function ie(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||re(e.type))return!0;if(e.inlineContent)return!1}}return!0}function ae(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||re(e.type))return!0;if(e.inlineContent)return!1}}return!0}function oe(){return new t.i({props:{decorations:ue,createSelectionBetween(e,t,n){return t.pos==n.pos&&D.valid(n)?new D(n):null},handleClick:ce,handleKeyDown:se,handleDOMEvents:{beforeinput:le}}})}var se=e.N({ArrowLeft:O(`horiz`,-1),ArrowRight:O(`horiz`,1),ArrowUp:O(`vert`,-1),ArrowDown:O(`vert`,1)});function O(e,n){let r=e==`vert`?n>0?`down`:`up`:n>0?`right`:`left`;return function(e,i,a){let o=e.selection,s=n>0?o.$to:o.$from,c=o.empty;if(o instanceof t.c){if(!a.endOfTextblock(r)||s.depth==0)return!1;c=!1,s=e.doc.resolve(n>0?s.after():s.before())}let l=D.findGapCursorFrom(s,n,c);return l?(i&&i(e.tr.setSelection(new D(l))),!0):!1}}function ce(e,n,r){if(!e||!e.editable)return!1;let i=e.state.doc.resolve(n);if(!D.valid(i))return!1;let a=e.posAtCoords({left:r.clientX,top:r.clientY});return a&&a.inside>-1&&t.r.isSelectable(e.state.doc.nodeAt(a.inside))?!1:(e.dispatch(e.state.tr.setSelection(new D(i))),!0)}function le(e,n){if(n.inputType!=`insertCompositionText`||!(e.state.selection instanceof D))return!1;let{$from:r}=e.state.selection,i=r.parent.contentMatchAt(r.index()).findWrapping(e.state.schema.nodes.text);if(!i)return!1;let a=t.w.empty;for(let e=i.length-1;e>=0;e--)a=t.w.from(i[e].createAndFill(null,a));let o=e.state.tr.replace(r.pos,r.pos,new t.A(a,0,0));return o.setSelection(t.c.near(o.doc.resolve(r.pos+1))),e.dispatch(o),!1}function ue(t){if(!(t.selection instanceof D))return null;let n=document.createElement(`div`);return n.className=`ProseMirror-gapcursor`,e.M.create(t.doc,[e.j.widget(t.selection.head,n,{key:`gapcursor`})])}var de=r.u(()=>oe()),fe=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),pe=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),me=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),he=e=>{let t=me(e);return t.charAt(0).toUpperCase()+t.slice(1)},ge={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},_e=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},ve=(0,u.createContext)({}),ye=()=>(0,u.useContext)(ve),be=(0,u.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:d=2,absoluteStrokeWidth:f=!1,color:p=`currentColor`,className:m=``}=ye()??{},h=r??f?Number(n??d)*24/Number(t??l):n??d;return(0,u.createElement)(`svg`,{ref:c,...ge,width:t??l??ge.width,height:t??l??ge.height,stroke:e??p,strokeWidth:h,className:fe(`lucide`,m,i),...!a&&!_e(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,u.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),k=(e,t)=>{let n=(0,u.forwardRef)(({className:n,...r},i)=>(0,u.createElement)(be,{ref:i,iconNode:t,className:fe(`lucide-${pe(he(e))}`,`lucide-${e}`,n),...r}));return n.displayName=he(e),n},xe=k(`bold`,[[`path`,{d:`M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8`,key:`mg9rjx`}]]),Se=k(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Ce=k(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),we=k(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),Te=k(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Ee=k(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),De=k(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),Oe=k(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),ke=k(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),Ae=k(`heading-1`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`m17 12 3-2v8`,key:`1hhhft`}]]),je=k(`heading-2`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1`,key:`9jr5yi`}]]),Me=k(`heading-3`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2`,key:`68ncm8`}],[`path`,{d:`M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2`,key:`1ejuhz`}]]),Ne=k(`heading-4`,[[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17 10v3a1 1 0 0 0 1 1h3`,key:`tj5zdr`}],[`path`,{d:`M21 10v8`,key:`1kdml4`}],[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}]]),Pe=k(`heading-6`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`circle`,{cx:`19`,cy:`16`,r:`2`,key:`15mx69`}],[`path`,{d:`M20 10c-2 2-3 3.5-3 6`,key:`f35dl0`}]]),Fe=k(`heading-5`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17 13v-3h4`,key:`1nvgqp`}],[`path`,{d:`M17 17.7c.4.2.8.3 1.3.3 1.5 0 2.7-1.1 2.7-2.5S19.8 13 18.3 13H17`,key:`2nebdn`}]]),Ie=k(`image-off`,[[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}],[`path`,{d:`M10.41 10.41a2 2 0 1 1-2.83-2.83`,key:`1bzlo9`}],[`line`,{x1:`13.5`,x2:`6`,y1:`13.5`,y2:`21`,key:`1q0aeu`}],[`line`,{x1:`18`,x2:`21`,y1:`12`,y2:`15`,key:`5mozeu`}],[`path`,{d:`M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59`,key:`mmje98`}],[`path`,{d:`M21 15V5a2 2 0 0 0-2-2H9`,key:`43el77`}]]),Le=k(`image-plus`,[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),Re=k(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),ze=k(`italic`,[[`line`,{x1:`19`,x2:`10`,y1:`4`,y2:`4`,key:`15jd3p`}],[`line`,{x1:`14`,x2:`5`,y1:`20`,y2:`20`,key:`bu0au3`}],[`line`,{x1:`15`,x2:`9`,y1:`4`,y2:`20`,key:`uljnxc`}]]),Be=k(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),Ve=k(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),He=k(`list-ordered`,[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]),Ue=k(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),We=k(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),Ge=k(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Ke=k(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),qe=k(`sigma`,[[`path`,{d:`M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2`,key:`wuwx1p`}]]),Je=k(`square-code`,[[`path`,{d:`m10 9-3 3 3 3`,key:`1oro0q`}],[`path`,{d:`m14 15 3-3-3-3`,key:`bz13h7`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),Ye=k(`square-function`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`path`,{d:`M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3`,key:`m1af9g`}],[`path`,{d:`M9 11.2h5.7`,key:`3zgcl2`}]]),Xe=k(`strikethrough`,[[`path`,{d:`M16 4H9a3 3 0 0 0-2.83 4`,key:`43sutm`}],[`path`,{d:`M14 12a4 4 0 0 1 0 8H6`,key:`nlfj13`}],[`line`,{x1:`4`,x2:`20`,y1:`12`,y2:`12`,key:`1e0a9i`}]]),Ze=k(`table`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]),Qe=k(`text-align-end`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M21 19H7`,key:`4cu937`}]]),$e=k(`text-align-center`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M17 12H7`,key:`16if0g`}],[`path`,{d:`M19 19H5`,key:`vjpgq2`}]]),et=k(`text-align-start`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]]),tt=k(`text-quote`,[[`path`,{d:`M17 5H3`,key:`1cn7zz`}],[`path`,{d:`M21 12H8`,key:`scolzb`}],[`path`,{d:`M21 19H8`,key:`13qgcb`}],[`path`,{d:`M3 12v7`,key:`1ri8j3`}]]),nt=k(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),rt=k(`type`,[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]),it=k(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),A=e=>typeof e==`string`,at=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},ot=e=>e==null?``:String(e),st=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},ct=/###/g,lt=e=>e&&e.includes(`###`)?e.replace(ct,`.`):e,ut=e=>!e||A(e),dt=(e,t,n)=>{let r=A(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(ut(e))return{};let t=lt(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return ut(e)?{}:{obj:e,k:lt(r[i])}},ft=(e,t,n)=>{let{obj:r,k:i}=dt(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=dt(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=dt(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},pt=(e,t,n,r)=>{let{obj:i,k:a}=dt(e,t,Object);i[a]=i[a]||[],i[a].push(n)},mt=(e,t)=>{let{obj:n,k:r}=dt(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},ht=(e,t,n)=>{let r=mt(e,n);return r===void 0?mt(t,n):r},gt=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?A(e[r])||e[r]instanceof String||A(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):gt(e[r],t[r],n):e[r]=t[r]);return e},_t=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),vt={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`,"/":`/`},yt=e=>A(e)?e.replace(/[&<>"'\/]/g,e=>vt[e]):e,bt=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}},xt=[` `,`,`,`?`,`!`,`;`],St=new bt(20),Ct=(e,t,n)=>{t||=``,n||=``;let r=xt.filter(e=>!t.includes(e)&&!n.includes(e));if(r.length===0)return!0;let i=St.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},wt=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].includes(typeof t)&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},Tt=e=>e?.replace(/_/g,`-`),Et={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},Dt=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||Et,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,`log`,``,!0)}warn(...e){return this.forward(e,`warn`,``,!0)}error(...e){return this.forward(e,`error`,``)}deprecate(...e){return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,n,r){return r&&!this.debug?null:(e=e.map(e=>A(e)?e.replace(/[\r\n\x00-\x1F\x7F]/g,` `):e),A(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},Ot=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}once(e,t){let n=(...r)=>{t(...r),this.off(e,n)};return this.on(e,n),this}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n(e,...t)})}},kt=class extends Ot{constructor(e,t={ns:[`translation`],defaultNS:`translation`}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.includes(`.`)?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):A(n)&&i?o.push(...n.split(i)):o.push(n)));let s=mt(this.data,o);return!s&&!t&&!n&&e.includes(`.`)&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!A(n)?s:wt(this.data?.[e]?.[t],n,i)}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.includes(`.`)&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),ft(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(A(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.includes(`.`)&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=mt(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?gt(s,n,i):s={...s,...n},ft(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},At={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},jt=Symbol(`i18next/PATH_KEY`);function Mt(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===jt?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function Nt(e,t){let{[jt]:n}=e(Mt()),r=t?.keySeparator??`.`,i=t?.nsSeparator??`:`,a=t?.enableSelector===`strict`;if(n.length>1&&i){let e=t?.ns,o=a?Array.isArray(e)?e:e?[e]:null:Array.isArray(e)?e:null;if(o&&(a?o:o.length>1?o.slice(1):[]).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var Pt=e=>!A(e)&&typeof e!=`boolean`&&typeof e!=`number`,Ft=class e extends Ot{constructor(e,t={}){super(),st([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=Dt.create(`translator`),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=Pt(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.includes(n),o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!Ct(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:A(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.includes(a[0]))&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:A(i)?[i]:i}}translate(t,n,r){let i=typeof n==`object`?{...n}:n;if(typeof i!=`object`&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i==`object`&&(i={...i}),i||={},t==null)return``;typeof t==`function`&&(t=Nt(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?Nt(e,{...this.options,...i}):String(e));let a=i.returnDetails===void 0?this.options.returnDetails:i.returnDetails,o=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,{key:s,namespaces:c}=this.extractFromKey(t[t.length-1],i),l=c[c.length-1],u=i.nsSeparator===void 0?this.options.nsSeparator:i.nsSeparator;u===void 0&&(u=`:`);let d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()===`cimode`)return f?a?{res:`${l}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${u}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;let p=this.resolve(t,i),m=p?.res,h=p?.usedKey||s,g=p?.exactUsedKey||s,_=[`[object Number]`,`[object Function]`,`[object RegExp]`],v=i.joinArrays===void 0?this.options.joinArrays:i.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=i.count!==void 0&&!A(i.count),x=e.hasDefaultValue(i),S=b?this.pluralResolver.getSuffix(d,i.count,i):``,C=i.ordinal&&b?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):``,w=b&&!i.ordinal&&i.count===0,T=w&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${C}`]||i.defaultValue,E=m;y&&!m&&x&&(E=T);let ee=Pt(E),te=Object.prototype.toString.apply(E);if(y&&E&&ee&&!_.includes(te)&&!(A(v)&&Array.isArray(E))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,E,{...i,ns:c}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(o){let e=Array.isArray(E),t=e?[]:{},n=e?g:h;for(let e in E)if(Object.prototype.hasOwnProperty.call(E,e)){let r=`${n}${o}${e}`;x&&!m?t[e]=this.translate(r,{...i,defaultValue:Pt(T)?T[e]:void 0,joinArrays:!1,ns:c}):t[e]=this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=E[e])}m=t}}else if(y&&A(v)&&Array.isArray(m))m=m.join(v),m&&=this.extendTranslation(m,t,i,r);else{let e=!1,n=!1;!this.isValidLookup(m)&&x&&(e=!0,m=T),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=x&&T!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,b&&!c?`${s}${this.pluralResolver.getSuffix(d,i.count,i)}`:s,c?T:m),o){let e=this.resolve(s,{...i,keySeparator:!1});e&&e.res&&this.logger.warn(`Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.`)}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);let n=(e,t,n)=>{let r=x&&n!==m?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,c,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,c,i),this.emit(`missingKey`,e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,i);w&&i[`defaultValue${this.options.pluralSeparator}zero`]&&!t.includes(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,i[`defaultValue${t}`]||T)})}):n(e,s,T))}m=this.extendTranslation(m,t,i,p,r),n&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${s}`),(n||e)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${s}`:s,e?m:void 0,i))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(i),p):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let a=A(e)&&(n?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:n.interpolation.skipOnVariables),o;if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!A(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;o<r&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...e)=>i?.[0]===e[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):this.translate(...e,t),n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,o=A(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=At.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,a,o;return A(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?Nt(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!A(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(A(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!this.checkedLoadedFor[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(this.checkedLoadedFor[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)),p.forEach(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&e.startsWith(i)&&o.push(c+e.replace(i,this.options.pluralSeparator)),o.push(c+e),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator||`_`}${t.context}`;o.push(r),u&&(t.ordinal&&e.startsWith(i)&&o.push(r+e.replace(i,this.options.pluralSeparator)),o.push(r+e),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!A(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.startsWith(`defaultValue`)&&e[t]!==void 0)return!0;return!1}},It=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Dt.create(`languageUtils`)}getScriptPartFromCode(e){if(e=Tt(e),!e||!e.includes(`-`))return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=Tt(e),!e||!e.includes(`-`))return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(A(e)&&e.includes(`-`)){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load===`languageOnly`||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>e===r?!0:!e.includes(`-`)&&!r.includes(`-`)?!1:!!(e.includes(`-`)&&!r.includes(`-`)&&e.slice(0,e.indexOf(`-`))===r||e.startsWith(r)&&r.length>1))}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),A(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||=e[this.getScriptPartFromCode(t)],n||=e[this.formatLanguageCode(t)],n||=e[this.getLanguagePartFromCode(t)],n||=e.default,n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return A(e)&&(e.includes(`-`)||e.includes(`_`))?(this.options.load!==`languageOnly`&&i(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&i(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&i(this.getLanguagePartFromCode(e))):A(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.includes(e)||i(this.formatLanguageCode(e))}),r}},Lt={zero:0,one:1,two:2,few:3,many:4,other:5},Rt={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},zt=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=Dt.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=Tt(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),Rt;if(!e.match(/-|_/))return Rt;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>Lt[e]-Lt[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix(`dev`,t,n))}},Bt=(e,t,n,r=`.`,i=!0)=>{let a=ht(e,t,n);return!a&&i&&A(n)&&(a=wt(e,n,r),a===void 0&&(a=wt(t,n,r))),a},Vt=e=>e.replace(/\$/g,`$$$$`),Ht=class{constructor(e={}){this.logger=Dt.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?yt:t,this.escapeValue=n===void 0?!0:n,this.useRawValueToEscape=r===void 0?!1:r,this.prefix=i?_t(i):a||`{{`,this.suffix=o?_t(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u?_t(u):`-`,this.unescapeSuffix=this.unescapePrefix?``:l?_t(l):``,this.nestingPrefix=d?_t(d):f||_t(`$t(`),this.nestingSuffix=p?_t(p):m||_t(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_===void 0?!1:_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(!e.includes(this.formatSeparator)){let i=Bt(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(Bt(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp(),!this.escapeValue&&typeof e==`string`&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn(`nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.`);let l=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>Vt(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Vt(this.escape(e)):Vt(e)}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0)if(typeof l==`function`){let t=l(e,i,r);a=A(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``;else !A(a)&&!this.useRawValueToEscape&&(a=ot(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(!e.includes(n))return e;let r=e.split(RegExp(`${_t(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.includes(this.prefix)&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!A(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=/{.*}/.test(r[1])?r[1].lastIndexOf(`}`)+1:r[1].indexOf(this.formatSeparator);if(c!==-1&&(s=r[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,c)),i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!A(i))return i;A(i)||(i=ot(i)),i||=(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),``),s.length&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}},Ut=e=>{let t=e.toLowerCase().trim(),n={};if(e.includes(`(`)){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].slice(0,-1);t===`currency`&&!i.includes(`:`)?n.currency||=i.trim():t===`relativetime`&&!i.includes(`:`)?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},Wt=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(Tt(r),i),t[o]=s),s(n)}},Gt=e=>(t,n,r)=>e(Tt(n),r)(t),Kt=class{constructor(e={}){this.logger=Dt.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?Wt:Gt;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Wt(t)}format(e,t,n,r={}){if(!t||e==null)return e;let i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf(`(`)>1&&!i[0].includes(`)`)&&i.find(e=>e.includes(`)`))){let e=i.findIndex(e=>e.includes(`)`));i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:a}=Ut(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}else this.logger.warn(`there was no format function for ${i}`);return e},e)}},qt=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},Jt=class extends Ot{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=Dt.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{pt(n.loaded,[i],a),qt(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read(e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();A(e)&&(e=this.languageUtils.toResolveHierarchy(e)),A(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);return}if(!(n==null||n===``)){if(this.backend?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}!e||!e[0]||this.store.addResource(e[0],t,n,r)}}},Yt=()=>({debug:!1,initAsync:!0,ns:[`translation`],defaultNS:[`translation`],fallbackLng:[`dev`],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:`all`,preload:!1,keySeparator:`.`,nsSeparator:`:`,pluralSeparator:`_`,contextSeparator:`_`,enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:`fallback`,saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]==`object`&&(t=e[1]),A(e[1])&&(t.defaultValue=e[1]),A(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Xt=e=>(A(e.ns)&&(e.ns=[e.ns]),A(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),A(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes(`cimode`)&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),e),Zt=()=>{},Qt=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},$t=class e extends Ot{constructor(e={},t){if(super(),this.options=Xt(e),this.services={},this.logger=Dt,this.modules={external:[]},Qt(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e==`function`&&(t=e,e={}),e.defaultNS==null&&e.ns&&(A(e.ns)?e.defaultNS=e.ns:e.ns.includes(`translation`)||(e.defaultNS=e.ns[0]));let n=Yt();this.options={...n,...this.options,...Xt(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!=`function`&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler);let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?Dt.init(r(this.modules.logger),this.options):Dt.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:Kt;let t=new It(this.options);this.store=new kt(this.options.resources,this.options);let n=this.services;n.logger=Dt,n.resourceStore=this.store,n.languageUtils=t,n.pluralResolver=new zt(t,{prepend:this.options.pluralSeparator}),e&&(n.formatter=r(e),n.formatter.init&&n.formatter.init(n,this.options),this.options.interpolation.format=n.formatter.format.bind(n.formatter)),n.interpolator=new Ht(this.options),n.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},n.backendConnector=new Jt(r(this.modules.backend),n.resourceStore,n,this.options),n.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(n.languageDetector=r(this.modules.languageDetector),n.languageDetector.init&&n.languageDetector.init(n,this.options.detection,this.options)),this.modules.i18nFormat&&(n.i18nFormat=r(this.modules.i18nFormat),n.i18nFormat.init&&n.i18nFormat.init(this)),this.translator=new Ft(this.services,this.options),this.translator.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||=Zt,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn(`init: no languageDetector is used and no lng is defined`),[`getResource`,`hasResourceBundle`,`getResourceBundle`,`getDataByLanguage`].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let i=at(),a=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn(`init: i18next is already initialized. You should call init just once!`),this.isInitialized=!0,this.options.isClone||this.logger.log(`initialized`,this.options),this.emit(`initialized`,this.options),i.resolve(n),t(e,n)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),i}loadResources(e,t=Zt){let n=t,r=A(e)?e:this.language;if(typeof e==`function`&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return n();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&(e.includes(t)||e.push(t))})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=at();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=Zt,this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);return e.type===`backend`&&(this.modules.backend=e),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&(this.modules.languageDetector=e),e.type===`i18nFormat`&&(this.modules.i18nFormat=e),e.type===`postProcessor`&&At.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&![`cimode`,`dev`].includes(e)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(![`cimode`,`dev`].includes(t)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&!this.languages.includes(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=at();this.emit(`languageChanging`,e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},a=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=A(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(A(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{i(e,a)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,n,r){let i=r?.scopeNs,a=(e,t,...r)=>{let o;o=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(r)),o.lng=o.lng||a.lng,o.lngs=o.lngs||a.lngs;let s=o.ns!==void 0&&o.ns!==null;o.ns=o.ns||a.ns,o.keyPrefix!==``&&(o.keyPrefix=o.keyPrefix||n||a.keyPrefix);let c={...this.options,...o};Array.isArray(i)&&!s&&(c.ns=i),typeof o.keyPrefix==`function`&&(o.keyPrefix=Nt(o.keyPrefix,c));let l=this.options.keySeparator||`.`,u;return o.keyPrefix&&Array.isArray(e)?u=e.map(e=>(typeof e==`function`&&(e=Nt(e,c)),`${o.keyPrefix}${l}${e}`)):(typeof e==`function`&&(e=Nt(e,c)),u=o.keyPrefix?`${o.keyPrefix}${l}${e}`:e),this.t(u,o)};return A(e)?a.lng=e:a.lngs=e,a.ns=t,a.keyPrefix=n,a}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn(`hasLoadedNamespace: i18next was not initialized`,this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn(`hasLoadedNamespace: i18n.languages were undefined or empty`,this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let n=at();return this.options.ns?(A(e)&&(e=[e]),e.forEach(e=>{this.options.ns.includes(e)||this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=at();A(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>!r.includes(e)&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language),!e)return`rtl`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=`ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`),n=this.services?.languageUtils||new It(Yt());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.includes(n.getLanguagePartFromCode(e))||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=Zt){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new kt(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),i),a.services.resourceStore=a.store),t.interpolation){let e={...Yt().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new Ht(n)}return a.translator=new Ft(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();$t.createInstance,$t.dir,$t.init,$t.loadResources,$t.reloadResources,$t.use,$t.changeLanguage,$t.getFixedT,$t.t,$t.exists,$t.setDefaultNamespace,$t.hasLoadedNamespace,$t.loadNamespaces,$t.loadLanguages;var en={placeholder:`Type / to open the command menu...`,initError:`Editor initialization failed. Please refresh the page and try again.`,editorAriaLabel:`Markdown editor`,mathBlockSourceAriaLabel:`Math block source`,mathBlockCopyAriaLabel:`Copy math source`,mathBlockDeleteAriaLabel:`Delete math block`,imageDeleteAriaLabel:`Delete image`,tableDeleteAriaLabel:`Delete table`,tableMoreAriaLabel:`More table actions`,tableAlignLeftAriaLabel:`Align current column left`,tableAlignCenterAriaLabel:`Align current column center`,tableAlignRightAriaLabel:`Align current column right`,tableInsertRowAboveLabel:`Insert row above`,tableInsertRowBelowLabel:`Insert row below`,tableInsertColumnLeftLabel:`Insert column left`,tableInsertColumnRightLabel:`Insert column right`,tableDeleteRowLabel:`Delete row`,tableDeleteColumnLabel:`Delete column`,mathRenderError:`Formula rendering failed. Please check the formula syntax.`,imageUploadDialogTitle:`Insert image`,imageUploadDropLabel:`Drop an image here, or choose a file`,imageUploadPickFileLabel:`Choose file`,imageUploadFileTab:`Upload file`,imageUploadUrlTab:`Image URL`,imageUploadUrlPlaceholder:`Paste image URL`,imageUploadInsertUrlLabel:`Insert URL`,imageUploadConfirmLabel:`Confirm`,imageUploadUploadingLabel:`Uploading...`,imageUploadCancelLabel:`Cancel`,imageUploadLoadFailed:`Image failed to load`,imageUploadReselectHint:`Click or drag to reselect`,imageUploadSupportsAndMax:`Supports image files, max {size}`,imageUploadFileTooLarge:`The image file is too large.`,imageUploadFileSizeExceeded:`Image size must not exceed {size}`,imageUploadInvalidType:`Please choose an image file.`,imageUploadFailed:`Image upload failed. Please try again.`,imageUploadFileReadFailed:`File read failed. Please try again.`,imageUploadInvalidUrl:`Please enter a valid image URL.`,imageUploadUrlRequired:`Please enter an image URL.`,imageUploadSelectOrEnterImage:`Please select an image or enter an image URL.`,imageUploadUploadingWait:`Image is uploading, please wait.`,selectionTooltipStrongTitle:`Bold`,selectionTooltipEmTitle:`Italic`,selectionTooltipStrikeTitle:`Strikethrough`,selectionTooltipInlineCodeTitle:`Inline code`,selectionTooltipLinkTitle:`Link`,selectionTooltipTransformLabel:`Turn into`,selectionTooltipTransformParagraphLabel:`Paragraph`,selectionTooltipTransformHeading1Label:`Heading 1`,selectionTooltipTransformHeading2Label:`Heading 2`,selectionTooltipTransformHeading3Label:`Heading 3`,selectionTooltipTransformHeading4Label:`Heading 4`,selectionTooltipTransformHeading5Label:`Heading 5`,selectionTooltipTransformHeading6Label:`Heading 6`,selectionTooltipTransformBulletListLabel:`Bullet list`,selectionTooltipTransformOrderedListLabel:`Ordered list`,selectionTooltipTransformTaskListLabel:`Task list`,selectionTooltipTransformBlockquoteLabel:`Blockquote`,selectionTooltipTransformCodeBlockLabel:`Code block`,selectionLinkInputPlaceholder:`Type or paste a link`,selectionLinkSaveAriaLabel:`Save link`,selectionLinkRemoveAriaLabel:`Remove link`,codeBlockLanguageSearchPlaceholder:`Search languages`,codeBlockLanguagePlainText:`text`,codeBlockCopyAriaLabel:`Copy code block`,codeBlockDeleteAriaLabel:`Delete code block`},tn={placeholder:`请输入 / 打开命令菜单...`,initError:`编辑器初始化失败,请刷新页面后重试。`,editorAriaLabel:`Markdown 编辑器`,mathBlockSourceAriaLabel:`公式块源码`,mathBlockCopyAriaLabel:`复制公式源码`,mathBlockDeleteAriaLabel:`删除公式块`,imageDeleteAriaLabel:`删除图片`,tableDeleteAriaLabel:`删除表格`,tableMoreAriaLabel:`更多表格操作`,tableAlignLeftAriaLabel:`当前列左对齐`,tableAlignCenterAriaLabel:`当前列居中对齐`,tableAlignRightAriaLabel:`当前列右对齐`,tableInsertRowAboveLabel:`上方插入行`,tableInsertRowBelowLabel:`下方插入行`,tableInsertColumnLeftLabel:`左侧插入列`,tableInsertColumnRightLabel:`右侧插入列`,tableDeleteRowLabel:`删除该行`,tableDeleteColumnLabel:`删除该列`,mathRenderError:`公式渲染失败,请检查公式语法。`,imageUploadDialogTitle:`插入图片`,imageUploadDropLabel:`拖拽图片到这里,或选择文件`,imageUploadPickFileLabel:`选择文件`,imageUploadFileTab:`上传文件`,imageUploadUrlTab:`图片链接`,imageUploadUrlPlaceholder:`粘贴图片链接`,imageUploadInsertUrlLabel:`插入链接`,imageUploadConfirmLabel:`确认`,imageUploadUploadingLabel:`上传中...`,imageUploadCancelLabel:`取消`,imageUploadLoadFailed:`图片加载失败`,imageUploadReselectHint:`点击或拖拽重新选择`,imageUploadSupportsAndMax:`支持图片文件,最大 {size}`,imageUploadFileTooLarge:`图片文件过大。`,imageUploadFileSizeExceeded:`图片大小不能超过 {size}`,imageUploadInvalidType:`请选择图片文件。`,imageUploadFailed:`图片上传失败,请重试。`,imageUploadFileReadFailed:`文件读取失败,请重试。`,imageUploadInvalidUrl:`请输入有效的图片链接。`,imageUploadUrlRequired:`请输入图片链接。`,imageUploadSelectOrEnterImage:`请选择图片或输入图片链接。`,imageUploadUploadingWait:`图片正在上传,请稍候。`,selectionTooltipStrongTitle:`加粗`,selectionTooltipEmTitle:`斜体`,selectionTooltipStrikeTitle:`删除线`,selectionTooltipInlineCodeTitle:`行内代码`,selectionTooltipLinkTitle:`链接`,selectionTooltipTransformLabel:`转换为`,selectionTooltipTransformParagraphLabel:`段落`,selectionTooltipTransformHeading1Label:`标题 1`,selectionTooltipTransformHeading2Label:`标题 2`,selectionTooltipTransformHeading3Label:`标题 3`,selectionTooltipTransformHeading4Label:`标题 4`,selectionTooltipTransformHeading5Label:`标题 5`,selectionTooltipTransformHeading6Label:`标题 6`,selectionTooltipTransformBulletListLabel:`无序列表`,selectionTooltipTransformOrderedListLabel:`有序列表`,selectionTooltipTransformTaskListLabel:`任务列表`,selectionTooltipTransformBlockquoteLabel:`引用块`,selectionTooltipTransformCodeBlockLabel:`代码块`,selectionLinkInputPlaceholder:`输入或粘贴链接`,selectionLinkSaveAriaLabel:`保存链接`,selectionLinkRemoveAriaLabel:`移除链接`,codeBlockLanguageSearchPlaceholder:`搜索语言`,codeBlockLanguagePlainText:`text`,codeBlockCopyAriaLabel:`复制代码块`,codeBlockDeleteAriaLabel:`删除代码块`},nn=`zh-CN`,rn={"zh-CN":{translation:tn},"en-US":{translation:en}},an=$t.createInstance(),on=!1,sn=()=>{on||=(an.init({resources:rn,fallbackLng:nn,lng:nn,interpolation:{escapeValue:!1}}),!0)},cn=(e=nn,t,n)=>{sn();let r={...an.getResourceBundle(e,`translation`),...t};return n!==void 0&&(r.placeholder=n),r},ln=new Set([`http:`,`https:`,`mailto:`,`tel:`]),un=/[\u0000-\u0020\u007f]+/g,dn=/^([a-z][a-z\d+\-.]*:)/i,fn=/[<>"'`]/,pn=new Set([`src`,`alt`,`title`,`style`]),mn=e=>{if(typeof e!=`string`)return``;let t=e.trim();if(!t||fn.test(t)||/[\u0000-\u001f\u007f]/.test(t))return``;let n=t.replace(un,``);if(n.startsWith(`//`))return``;let r=n.match(dn)?.[1]?.toLowerCase()??``;if(!r)return t;if(!ln.has(r))return``;try{return new URL(t).toString()}catch{return``}},hn=(e,t)=>{if(typeof e!=`string`)return null;let n=e.trim();if(!n)return null;let r=new DOMParser().parseFromString(n,`text/html`),i=null;for(let e of Array.from(r.body.childNodes))if(!(e.nodeType===Node.TEXT_NODE&&!(e.textContent??``).trim())){if(e instanceof HTMLImageElement&&i===null){i=e;continue}return null}if(!i||i.tagName.toLowerCase()!==`img`)return null;for(let e of Array.from(i.attributes))if(!pn.has(e.name.toLowerCase()))return null;let a=mn(i.getAttribute(`src`)??``);return a?{src:a,alt:i.getAttribute(`alt`)??``,title:i.getAttribute(`title`)??``,style:t(i.getAttribute(`style`)??``)}:null},gn=/^\s*width\s*:\s*(\d{1,3})%\s*;?\s*$/i,_n=e=>{let t=Array.isArray(e.children)?e.children:[],n=t[0];return t.length!==1||n?.type!==`image`?null:n},vn=e=>Math.min(100,Math.max(10,e)),yn=e=>`width: ${vn(Math.round(e))}%;`,bn=e=>{if(typeof e!=`string`)return null;let t=e.match(gn);if(!t)return null;let n=Number(t[1]);return Number.isFinite(n)?vn(n):null},xn=e=>{let t=bn(e);return t===null?``:yn(t)},Sn=e=>typeof e==`string`?e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`).replace(/>/g,`>`):``,Cn=e=>{let t=mn(e.src);if(!t)return``;let n=typeof e.alt==`string`?e.alt:``,r=typeof e.title==`string`?e.title:``,i=r?` title="${Sn(r)}"`:``,a=xn(e.style);return`<img src="${Sn(t)}" alt="${Sn(n)}"${i} style="${Sn(a)}">`},wn=e=>t=>{let n=e(t);return{...n,inline:!1,group:`block`,attrs:{...n.attrs,style:{default:``,validate:`string`}},parseDOM:[{tag:`img[src]`,getAttrs:e=>{let t=e,n=mn(t.getAttribute(`src`)??``);return n?{src:n,alt:t.getAttribute(`alt`)??``,title:t.getAttribute(`title`)??t.getAttribute(`alt`)??``,style:xn(t.getAttribute(`style`)??``)}:!1}}],parseMarkdown:{match:e=>e.type===`image`||e.type===`html`&&hn(e.value,xn)!==null,runner:(e,t,n)=>{if(t.type===`html`){let r=hn(t.value,xn);r&&e.addNode(n,r);return}let r=mn(String(t.url??``));r&&e.addNode(n,{src:r,alt:String(t.alt??``),title:String(t.title??``),style:``})}},toMarkdown:{match:e=>e.type.name===`image`,runner:(e,t)=>{let n=mn(t.attrs.src);if(!n)return;let r=xn(t.attrs.style);if(r){let i=Cn({...t.attrs,src:n,style:r});i&&e.addNode(`html`,void 0,i);return}e.addNode(`image`,void 0,void 0,{title:t.attrs.title,url:n,alt:t.attrs.alt})}}}},Tn=e=>t=>{let n=e(t);return{...n,parseMarkdown:{...n.parseMarkdown,runner:(e,t,r)=>{let i=_n(t);if(i){e.next(i);return}n.parseMarkdown.runner(e,t,r)}}}},En=e=>{let t=e.get(a.t.key),n=e.get(a.i.key);e.set(a.t.key,wn(t)),e.set(a.i.key,Tn(n))},Dn=`image`,On=`left`,kn=`right`,An=160,jn=(e=>(0,d.renderToStaticMarkup)((0,u.createElement)(e,{size:14,strokeWidth:2,"aria-hidden":`true`})))(nt),Mn=e=>typeof e==`function`?e():null,Nn=e=>typeof e.props.editable==`function`?e.props.editable(e.state):e.editable,Pn=class{constructor(e,t,n,r){this.resizeState=null,this.isSelected=!1,this.currentImageSrc=``,this.imageLoadingStartedAt=0,this.imageLoadingFinishTimer=null,this.handleDeleteClick=e=>{e.preventDefault(),e.stopPropagation(),Nn(this.view)&&this.deleteCurrentImage()},this.handleImageLoad=()=>{this.finishImageLoadingWithMinimumDuration()},this.handleImageError=()=>{this.finishImageLoadingWithMinimumDuration()},this.handleResizePointerDown=e=>{if(e.preventDefault(),e.stopPropagation(),!Nn(this.view))return;let t=e.currentTarget;if(!(t instanceof HTMLElement))return;let n=t.dataset.side===On?On:kn,r=this.dom.parentElement;if(!r)return;let i=this.imageElement.getBoundingClientRect(),a=r.getBoundingClientRect();if(i.width<=0||a.width<=0)return;let o=vn(i.width/a.width*100);this.resizeState={side:n,startClientX:e.clientX,startWidth:i.width,containerWidth:a.width,widthPercent:o},this.dom.dataset.resizing=`true`,this.applyPreviewWidth(o),window.addEventListener(`pointermove`,this.handleResizePointerMove),window.addEventListener(`pointerup`,this.handleResizePointerUp),window.addEventListener(`pointercancel`,this.handleResizePointerUp)},this.handleResizePointerMove=e=>{if(!this.resizeState)return;e.preventDefault();let t=e.clientX-this.resizeState.startClientX,n=this.resizeState.side===On?-t:t,r=vn((this.resizeState.startWidth+n)/this.resizeState.containerWidth*100);this.resizeState.widthPercent=r,this.applyPreviewWidth(r)},this.handleResizePointerUp=e=>{if(e.preventDefault(),!this.resizeState)return;let t=Math.round(this.resizeState.widthPercent);this.resizeState=null,delete this.dom.dataset.resizing,this.removeResizeWindowListeners(),this.commitImageWidth(t)},this.node=e,this.view=t,this.getPos=n,this.deleteAriaLabel=r.imageDeleteAriaLabel,this.dom=document.createElement(`span`),this.dom.dataset.type=Dn,this.dom.className=`zt-md-image`,this.updateEditableState(),this.syncSelectedState(),this.imageElement=document.createElement(`img`),this.imageElement.addEventListener(`load`,this.handleImageLoad),this.imageElement.addEventListener(`error`,this.handleImageError),this.leftResizeHandle=this.createResizeHandle(On),this.rightResizeHandle=this.createResizeHandle(kn),this.actionsContainer=document.createElement(`span`),this.actionsContainer.className=`zt-md-image-actions`,this.deleteButton=document.createElement(`button`),this.deleteButton.type=`button`,this.deleteButton.className=`zt-md-image-action-button zt-md-image-action-button-danger`,this.deleteButton.setAttribute(`aria-label`,this.deleteAriaLabel),this.deleteButton.innerHTML=jn,this.actionsContainer.appendChild(this.deleteButton),this.dom.append(this.imageElement,this.leftResizeHandle,this.rightResizeHandle,this.actionsContainer),this.syncFromNode(e),this.deleteButton.addEventListener(`click`,this.handleDeleteClick),this.leftResizeHandle.addEventListener(`pointerdown`,this.handleResizePointerDown),this.rightResizeHandle.addEventListener(`pointerdown`,this.handleResizePointerDown)}createResizeHandle(e){let t=document.createElement(`span`);return t.className=`zt-md-image-resize-handle zt-md-image-resize-handle-${e}`,t.dataset.side=e,t.setAttribute(`aria-hidden`,`true`),t}deleteCurrentImage(){let e=Mn(this.getPos);if(e===null)return;let t=this.view.state.tr.delete(e,e+this.node.nodeSize).scrollIntoView();this.view.dispatch(t),requestAnimationFrame(()=>{this.view.focus()})}updateEditableState(){this.dom.dataset.editable=Nn(this.view)?`true`:`false`}syncSelectedState(){this.dom.dataset.selected=this.isSelected?`true`:`false`}markImageLoading(){this.clearImageLoadingFinishTimer(),this.imageLoadingStartedAt=performance.now(),this.dom.dataset.loading=`true`}finishImageLoading(){this.clearImageLoadingFinishTimer(),delete this.dom.dataset.loading}finishImageLoadingWithMinimumDuration(){let e=performance.now()-this.imageLoadingStartedAt,t=Math.max(0,An-e);if(t<=0){this.finishImageLoading();return}this.clearImageLoadingFinishTimer(),this.imageLoadingFinishTimer=window.setTimeout(()=>{this.finishImageLoading()},t)}clearImageLoadingFinishTimer(){this.imageLoadingFinishTimer!==null&&(window.clearTimeout(this.imageLoadingFinishTimer),this.imageLoadingFinishTimer=null)}removeResizeWindowListeners(){window.removeEventListener(`pointermove`,this.handleResizePointerMove),window.removeEventListener(`pointerup`,this.handleResizePointerUp),window.removeEventListener(`pointercancel`,this.handleResizePointerUp)}applyPreviewWidth(e){this.dom.style.width=`${Math.round(e)}%`,this.dom.dataset.hasWidth=`true`}commitImageWidth(e){let t=Mn(this.getPos);if(t===null)return;let n={...this.node.attrs,style:yn(e)},r=this.view.state.tr.setNodeMarkup(t,void 0,n);this.view.dispatch(r),requestAnimationFrame(()=>{this.view.focus()})}syncFromNode(e){this.updateEditableState();let t=typeof e.attrs.src==`string`?e.attrs.src:``,n=typeof e.attrs.alt==`string`?e.attrs.alt:``,r=typeof e.attrs.title==`string`?e.attrs.title:``,i=bn(xn(e.attrs.style));t!==this.currentImageSrc&&t&&this.markImageLoading(),this.imageElement.setAttribute(`src`,t),this.currentImageSrc=t,this.imageElement.setAttribute(`alt`,n),r?this.imageElement.title=r:this.imageElement.removeAttribute(`title`),i===null?(this.dom.style.removeProperty(`width`),delete this.dom.dataset.hasWidth):(this.dom.style.width=`${i}%`,this.dom.dataset.hasWidth=`true`),t?this.imageElement.complete&&this.imageElement.naturalWidth>0&&this.finishImageLoadingWithMinimumDuration():this.finishImageLoading()}update(e){return e.type.name===Dn?(this.node=e,this.syncFromNode(e),!0):!1}selectNode(){this.isSelected=!0,this.syncSelectedState()}deselectNode(){this.isSelected=!1,this.syncSelectedState()}stopEvent(e){let t=e.target;return t instanceof Node?this.deleteButton.contains(t)||this.leftResizeHandle.contains(t)||this.rightResizeHandle.contains(t)||this.resizeState!==null:!1}ignoreMutation(){return!0}destroy(){this.removeResizeWindowListeners(),this.clearImageLoadingFinishTimer(),this.imageElement.removeEventListener(`load`,this.handleImageLoad),this.imageElement.removeEventListener(`error`,this.handleImageError),this.deleteButton.removeEventListener(`click`,this.handleDeleteClick),this.leftResizeHandle.removeEventListener(`pointerdown`,this.handleResizePointerDown),this.rightResizeHandle.removeEventListener(`pointerdown`,this.handleResizePointerDown)}},Fn=(e=cn())=>(t,n,r)=>new Pn(t,n,typeof r==`function`?()=>{let e=r();return typeof e==`number`?e:0}:!1,e),In=`image`,Ln={Backspace:`before`,Delete:`after`},Rn=e=>typeof e.props.editable==`function`?e.props.editable(e.state):e.editable,zn=e=>e instanceof Element?!!e.closest(`.zt-md-image-actions, .zt-md-image-resize-handle`):!1,Bn=e=>e?.type.name===In,Vn=(e,t)=>!Ln[t.key]||t.defaultPrevented||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||!Rn(e)||zn(t.target)||zn(document.activeElement),Hn=e=>{if(e.parent.type.name!==`paragraph`||e.parentOffset!==0||e.parent.textContent.length>0||e.depth<1)return null;let t=e.index(e.depth-1);if(t<=0)return null;let n=e.node(e.depth-1).child(t-1);return Bn(n)?{previousBlockStart:e.before(e.depth)-n.nodeSize}:null},Un=(e,n)=>{try{return t.c.create(e,n)}catch{return t.c.near(e.resolve(n),-1)}},Wn=(e,t,n)=>{n.preventDefault();let r=t.from,i=e.state.tr.delete(t.from,t.to),a=i.doc.content.size,o=Math.min(r,a);return i.setSelection(Un(i.doc,o)).scrollIntoView(),e.dispatch(i),e.focus(),!0},Gn=(e,n)=>{if(n.key!==`Backspace`)return!1;let{selection:r}=e.state;if(!r.empty)return!1;let i=r.$from,a=Hn(i);if(!a)return!1;let o=i.before(i.depth),s=o+i.parent.nodeSize;n.preventDefault();let c=e.state.tr;return c.delete(o,s),c.setSelection(t.r.create(c.doc,a.previousBlockStart)).scrollIntoView(),e.dispatch(c),e.focus(),!0},Kn=(e,n)=>{if(Gn(e,n))return!0;let r=Ln[n.key];if(!r)return!1;let{selection:i}=e.state;if(!i.empty)return!1;let a=i.$from,o=r===`before`?a.nodeBefore:a.nodeAfter;if(!Bn(o))return!1;n.preventDefault();let s=r===`before`?i.from-o.nodeSize:i.from;return e.dispatch(e.state.tr.setSelection(t.r.create(e.state.doc,s)).scrollIntoView()),e.focus(),!0},qn=(e,n)=>{if(Vn(e,n))return!1;let{selection:r}=e.state;return r instanceof t.r&&Bn(r.node)?Wn(e,r,n):Kn(e,n)},Jn=r.u(()=>new t.i({key:new t.a(`zt-md-image-delete-selection`),props:{handleKeyDown:(e,t)=>qn(e,t)}})),Yn=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Xn=g,Zn=(e,t)=>n=>{if(t?.variants==null)return Xn(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Yn(t)||Yn(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Xn(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};function Qn(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function $n(...e){return t=>{let n=!1,r=e.map(e=>{let r=Qn(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Qn(e[t],null)}}}}function er(...e){return u.useCallback($n(...e),e)}function tr(e){let t=rr(e),n=u.forwardRef((e,n)=>{let{children:r,...i}=e,a=u.Children.toArray(r),o=a.find(ar);if(o){let e=o.props.children,r=a.map(t=>t===o?u.Children.count(e)>1?u.Children.only(null):u.isValidElement(e)?e.props.children:null:t);return(0,m.jsx)(t,{...i,ref:n,children:u.isValidElement(e)?u.cloneElement(e,void 0,r):null})}return(0,m.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}var nr=tr(`Slot`);function rr(e){let t=u.forwardRef((e,t)=>{let{children:n,...r}=e;if(u.isValidElement(n)){let e=sr(n),i=or(r,n.props);return n.type!==u.Fragment&&(i.ref=t?$n(t,e):e),u.cloneElement(n,i)}return u.Children.count(n)>1?u.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ir=Symbol(`radix.slottable`);function ar(e){return u.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===ir}function or(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function sr(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var cr=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=tr(`Primitive.${t}`),r=u.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,m.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function lr(e,t){e&&p.flushSync(()=>e.dispatchEvent(t))}function ur(e,t){let n=u.createContext(t),r=e=>{let{children:t,...r}=e,i=u.useMemo(()=>r,Object.values(r));return(0,m.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=u.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function dr(e,t=[]){let n=[];function r(t,r){let i=u.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=u.useMemo(()=>o,Object.values(o));return(0,m.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=u.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>u.createContext(e));return function(n){let r=n?.[e]||t;return u.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,fr(i,...t)]}function fr(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}typeof window<`u`&&window.document&&window.document.createElement;function pr(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var mr=globalThis?.document?u.useLayoutEffect:()=>{},hr=u.useInsertionEffect||mr;function gr({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=_r({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=u.useRef(e!==void 0);u.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,u.useCallback(t=>{if(s){let n=vr(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function _r({defaultProp:e,onChange:t}){let[n,r]=u.useState(e),i=u.useRef(n),a=u.useRef(t);return hr(()=>{a.current=t},[t]),u.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function vr(e){return typeof e==`function`}function yr(e,t){return u.useReducer((e,n)=>t[e][n]??e,e)}var br=e=>{let{present:t,children:n}=e,r=xr(t),i=typeof n==`function`?n({present:r.isPresent}):u.Children.only(n),a=er(r.ref,Cr(i));return typeof n==`function`||r.isPresent?u.cloneElement(i,{ref:a}):null};br.displayName=`Presence`;function xr(e){let[t,n]=u.useState(),r=u.useRef(null),i=u.useRef(e),a=u.useRef(`none`),[o,s]=yr(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return u.useEffect(()=>{let e=Sr(r.current);a.current=o===`mounted`?e:`none`},[o]),mr(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=Sr(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),mr(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Sr(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=Sr(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:u.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function Sr(e){return e?.animationName||`none`}function Cr(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var wr=u.useId||(()=>void 0),Tr=0;function Er(e){let[t,n]=u.useState(wr());return mr(()=>{e||n(e=>e??String(Tr++))},[e]),e||(t?`radix-${t}`:``)}function Dr(e){let t=u.useRef(e);return u.useEffect(()=>{t.current=e}),u.useMemo(()=>(...e)=>t.current?.(...e),[])}function Or(e,t=globalThis?.document){let n=Dr(e);u.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var kr=`DismissableLayer`,Ar=`dismissableLayer.update`,jr=`dismissableLayer.pointerDownOutside`,Mr=`dismissableLayer.focusOutside`,Nr,Pr=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Fr=u.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=u.useContext(Pr),[d,f]=u.useState(null),p=d?.ownerDocument??globalThis?.document,[,h]=u.useState({}),g=er(t,e=>f(e)),_=Array.from(l.layers),[v]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),y=_.indexOf(v),b=d?_.indexOf(d):-1,x=l.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=Rr(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!S||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},p),w=zr(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},p);return Or(e=>{b===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},p),u.useEffect(()=>{if(d)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Nr=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(d)),l.layers.add(d),Br(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Nr)}},[d,p,n,l]),u.useEffect(()=>()=>{d&&(l.layers.delete(d),l.layersWithOutsidePointerEventsDisabled.delete(d),Br())},[d,l]),u.useEffect(()=>{let e=()=>h({});return document.addEventListener(Ar,e),()=>document.removeEventListener(Ar,e)},[]),(0,m.jsx)(cr.div,{...c,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:pr(e.onFocusCapture,w.onFocusCapture),onBlurCapture:pr(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:pr(e.onPointerDownCapture,C.onPointerDownCapture)})});Fr.displayName=kr;var Ir=`DismissableLayerBranch`,Lr=u.forwardRef((e,t)=>{let n=u.useContext(Pr),r=u.useRef(null),i=er(t,r);return u.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,m.jsx)(cr.div,{...e,ref:i})});Lr.displayName=Ir;function Rr(e,t=globalThis?.document){let n=Dr(e),r=u.useRef(!1),i=u.useRef(()=>{});return u.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){Vr(jr,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function zr(e,t=globalThis?.document){let n=Dr(e),r=u.useRef(!1);return u.useEffect(()=>{let e=e=>{e.target&&!r.current&&Vr(Mr,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Br(){let e=new CustomEvent(Ar);document.dispatchEvent(e)}function Vr(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?lr(i,a):i.dispatchEvent(a)}var Hr=`focusScope.autoFocusOnMount`,Ur=`focusScope.autoFocusOnUnmount`,Wr={bubbles:!1,cancelable:!0},Gr=`FocusScope`,Kr=u.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=u.useState(null),l=Dr(i),d=Dr(a),f=u.useRef(null),p=er(t,e=>c(e)),h=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(r){let e=function(e){if(h.paused||!s)return;let t=e.target;s.contains(t)?f.current=t:$r(f.current,{select:!0})},t=function(e){if(h.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||$r(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&$r(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,h.paused]),u.useEffect(()=>{if(s){ei.add(h);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Hr,Wr);s.addEventListener(Hr,l),s.dispatchEvent(t),t.defaultPrevented||(qr(ri(Yr(s)),{select:!0}),document.activeElement===e&&$r(s))}return()=>{s.removeEventListener(Hr,l),setTimeout(()=>{let t=new CustomEvent(Ur,Wr);s.addEventListener(Ur,d),s.dispatchEvent(t),t.defaultPrevented||$r(e??document.body,{select:!0}),s.removeEventListener(Ur,d),ei.remove(h)},0)}}},[s,l,d,h]);let g=u.useCallback(e=>{if(!n&&!r||h.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Jr(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&$r(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&$r(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,h.paused]);return(0,m.jsx)(cr.div,{tabIndex:-1,...o,ref:p,onKeyDown:g})});Kr.displayName=Gr;function qr(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if($r(r,{select:t}),document.activeElement!==n)return}function Jr(e){let t=Yr(e);return[Xr(t,e),Xr(t.reverse(),e)]}function Yr(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Xr(e,t){for(let n of e)if(!Zr(n,{upTo:t}))return n}function Zr(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Qr(e){return e instanceof HTMLInputElement&&`select`in e}function $r(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Qr(e)&&t&&e.select()}}var ei=ti();function ti(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=ni(e,t),e.unshift(t)},remove(t){e=ni(e,t),e[0]?.resume()}}}function ni(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ri(e){return e.filter(e=>e.tagName!==`A`)}var ii=`Portal`,ai=u.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=u.useState(!1);mr(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?p.default.createPortal((0,m.jsx)(cr.div,{...r,ref:t}),o):null});ai.displayName=ii;var oi=0;function si(){u.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??ci()),document.body.insertAdjacentElement(`beforeend`,e[1]??ci()),oi++,()=>{oi===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),oi--}},[])}function ci(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var li=function(){return li=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},li.apply(this,arguments)};function ui(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function di(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var fi=`right-scroll-bar-position`,pi=`width-before-scroll-bar`,mi=`with-scroll-bars-hidden`,hi=`--removed-body-scroll-bar-size`;function gi(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function _i(e,t){var n=(0,l.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var vi=typeof window<`u`?l.useLayoutEffect:l.useEffect,yi=new WeakMap;function bi(e,t){var n=_i(t||null,function(t){return e.forEach(function(e){return gi(e,t)})});return vi(function(){var t=yi.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||gi(e,null)}),i.forEach(function(e){r.has(e)||gi(e,a)})}yi.set(n,e)},[e]),n}function xi(e){return e}function Si(e,t){t===void 0&&(t=xi);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Ci(e){e===void 0&&(e={});var t=Si(null);return t.options=li({async:!0,ssr:!1},e),t}var wi=function(e){var t=e.sideCar,n=ui(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return l.createElement(r,li({},n))};wi.isSideCarExport=!0;function Ti(e,t){return e.useMedium(t),wi}var Ei=Ci(),Di=function(){},Oi=l.forwardRef(function(e,t){var n=l.useRef(null),r=l.useState({onScrollCapture:Di,onWheelCapture:Di,onTouchMoveCapture:Di}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=ui(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=bi([n,t]),w=li(li({},x),i);return l.createElement(l.Fragment,null,d&&l.createElement(S,{sideCar:Ei,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?l.cloneElement(l.Children.only(s),li(li({},w),{ref:C})):l.createElement(y,li({},w,{className:c,ref:C}),s))});Oi.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Oi.classNames={fullWidth:pi,zeroRight:fi};var ki,Ai=function(){if(ki)return ki;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function ji(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Ai();return t&&e.setAttribute(`nonce`,t),e}function Mi(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ni(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Pi=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ji())&&(Mi(t,n),Ni(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Fi=function(){var e=Pi();return function(t,n){l.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ii=function(){var e=Fi();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Li={left:0,top:0,right:0,gap:0},Ri=function(e){return parseInt(e||``,10)||0},zi=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Ri(n),Ri(r),Ri(i)]},Bi=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Li;var t=zi(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Vi=Ii(),Hi=`data-scroll-locked`,Ui=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
2
|
-
.${mi} {
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let u=require("react"),d=l(u,1);u=l(u);let f=require("react-dom/server"),p=require("react-dom/client"),m=require("react-dom");m=l(m,1);let h=require("react/jsx-runtime");var g=(0,d.createContext)({});function _(){let{dom:e,editor:t,setLoading:n,editorFactory:r}=(0,d.useContext)(g),i=(0,d.useRef)(null);return(0,d.useEffect)(()=>{let a=i.current;if(!r||!a)return;e.current=a;let o=r(a);if(o)return n(!0),o.create().then(e=>{t.current=e}).finally(()=>{n(!1)}).catch(console.error),()=>{o.destroy().catch(console.error)}},[e,t,r,n]),i}var v=()=>{let e=_();return d.default.createElement(`div`,{"data-milkdown-root":!0,ref:e})},y=({children:e})=>{let t=(0,d.useRef)(void 0),[n,r]=(0,d.useState)(void 0),i=(0,d.useRef)(void 0),[a,o]=(0,d.useState)(!0),s=(0,d.useMemo)(()=>({loading:a,dom:t,editor:i,setLoading:o,editorFactory:n,setEditorFactory:r}),[a,n]);return d.default.createElement(g.Provider,{value:s},e)};function b(e,t=[]){let n=(0,d.useContext)(g),r=(0,d.useCallback)(e,t);return(0,d.useLayoutEffect)(()=>{n.setEditorFactory(()=>r)},[n,r]),{loading:n.loading,get:()=>n.editor.current}}function x(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=x(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function S(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=x(e))&&(r&&(r+=` `),r+=t);return r}var C=e=>typeof e==`string`?e:``,w=(e,t,n)=>{let r=typeof e==`string`,[i,a]=(0,d.useState)(C(t));return{markdown:(0,d.useMemo)(()=>r?C(e):i,[i,r,e]),setMarkdown:(0,d.useCallback)(e=>{r||a(e),n?.(e)},[r,n]),isControlled:r}};function T(e,t,{signal:n,edges:r}={}){let i,a=null,o=r!=null&&r.includes(`leading`),s=r==null||r.includes(`trailing`),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},l=()=>{s&&c(),p()},u=null,d=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,l()},t)},f=()=>{u!==null&&(clearTimeout(u),u=null)},p=()=>{f(),i=void 0,a=null},m=()=>{c()},h=function(...e){if(n?.aborted)return;i=this,a=e;let t=u==null;d(),o&&t&&c()};return h.schedule=d,h.cancel=p,h.flush=m,n?.addEventListener(`abort`,p,{once:!0}),h}var E=function(e){return e.docTypeError=`docTypeError`,e.contextNotFound=`contextNotFound`,e.timerNotFound=`timerNotFound`,e.ctxCallOutOfScope=`ctxCallOutOfScope`,e.createNodeInParserFail=`createNodeInParserFail`,e.stackOverFlow=`stackOverFlow`,e.parserMatchError=`parserMatchError`,e.serializerMatchError=`serializerMatchError`,e.getAtomFromSchemaFail=`getAtomFromSchemaFail`,e.expectDomTypeError=`expectDomTypeError`,e.callCommandBeforeEditorView=`callCommandBeforeEditorView`,e.missingRootElement=`missingRootElement`,e.missingNodeInSchema=`missingNodeInSchema`,e.missingMarkInSchema=`missingMarkInSchema`,e.ctxNotBind=`ctxNotBind`,e.missingYjsDoc=`missingYjsDoc`,e.aiProviderError=`aiProviderError`,e.aiBuildContextError=`aiBuildContextError`,e}({}),D=class extends Error{constructor(e,t,n){super(t,n),this.name=`MilkdownError`,this.code=e,n?.cause!==void 0&&(this.cause=n.cause)}},ee=(e,t)=>typeof t==`function`?`[Function]`:t,te=e=>JSON.stringify(e,ee);function ne(e){return new D(E.docTypeError,`Doc type error, unsupported type: ${te(e)}`)}function re(e){return new D(E.contextNotFound,`Context "${e}" not found, do you forget to inject it?`)}function ie(e){return new D(E.timerNotFound,`Timer "${e}" not found, do you forget to record it?`)}function ae(){return new D(E.ctxCallOutOfScope,`Should not call a context out of the plugin.`)}function oe(e,t,n){let r=`Cannot create node for ${`name`in e?e.name:e}`,i=e=>{if(e==null)return`null`;if(Array.isArray(e))return`[${e.map(i).join(`, `)}]`;if(typeof e==`object`)return`toJSON`in e&&typeof e.toJSON==`function`?JSON.stringify(e.toJSON()):`spec`in e?JSON.stringify(e.spec):JSON.stringify(e);if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`)return JSON.stringify(e);if(typeof e==`function`)return`[Function: ${e.name||`anonymous`}]`;try{return String(e)}catch{return`[Unserializable]`}},a=[[`[Description]`,r],[`[Attributes]`,t],[`[Content]`,(n??[]).map(e=>e?typeof e==`object`&&`type`in e?`${e}`:i(e):`null`)]].reduce((e,[t,n])=>{let r=`${t}: ${i(n)}.`;return e.concat(r)},[]);return new D(E.createNodeInParserFail,a.join(`
|
|
2
|
+
`))}function se(){return new D(E.stackOverFlow,`Stack over flow, cannot pop on an empty stack.`)}function O(e){return new D(E.parserMatchError,`Cannot match target parser for node: ${te(e)}.`)}function ce(e){return new D(E.serializerMatchError,`Cannot match target serializer for node: ${te(e)}.`)}function le(e,t){return new D(E.getAtomFromSchemaFail,`Cannot get ${e}: ${t} from schema.`)}function ue(e){return new D(E.expectDomTypeError,`Expect to be a dom, but get: ${te(e)}.`)}function de(){return new D(E.callCommandBeforeEditorView,`You're trying to call a command before editor view initialized, make sure to get commandManager from ctx after editor view has been initialized`)}function fe(e){return new D(E.missingNodeInSchema,`Missing node in schema, milkdown cannot find "${e}" in schema.`)}function pe(e){return new D(E.missingMarkInSchema,`Missing mark in schema, milkdown cannot find "${e}" in schema.`)}var me=class{constructor(){this.sliceMap=new Map,this.get=e=>{let t=typeof e==`string`?[...this.sliceMap.values()].find(t=>t.type.name===e):this.sliceMap.get(e.id);if(!t)throw re(typeof e==`string`?e:e.name);return t},this.remove=e=>{let t=typeof e==`string`?[...this.sliceMap.values()].find(t=>t.type.name===e):this.sliceMap.get(e.id);t&&this.sliceMap.delete(t.type.id)},this.has=e=>typeof e==`string`?[...this.sliceMap.values()].some(t=>t.type.name===e):this.sliceMap.has(e.id)}},he=class{#e;#t;#n;constructor(e,t,n){this.#e=[],this.#n=()=>{this.#e.forEach(e=>e(this.#t))},this.set=e=>{this.#t=e,this.#n()},this.get=()=>this.#t,this.update=e=>{this.#t=e(this.#t),this.#n()},this.type=n,this.#t=t,e.set(n.id,this)}on(e){return this.#e.push(e),()=>{this.#e=this.#e.filter(t=>t!==e)}}once(e){let t=this.on(n=>{e(n),t()});return t}off(e){this.#e=this.#e.filter(t=>t!==e)}offAll(){this.#e=[]}},ge=class{constructor(e,t){this.id=Symbol(`Context-${t}`),this.name=t,this._defaultValue=e,this._typeInfo=()=>{throw ae()}}create(e,t=this._defaultValue){return new he(e,t,this)}},_e=(e,t)=>new ge(e,t),ve=class{#e;#t;#n;#r;#i;#a;#o;constructor(e,t,n){this.#r=new Set,this.#i=new Set,this.#a=new Map,this.#o=new Map,this.read=()=>({metadata:this.#e,injectedSlices:[...this.#r].map(e=>({name:typeof e==`string`?e:e.name,value:this.#s(e)})),consumedSlices:[...this.#i].map(e=>({name:typeof e==`string`?e:e.name,value:this.#s(e)})),recordedTimers:[...this.#a].map(([e,{duration:t}])=>({name:e.name,duration:t,status:this.#c(e)})),waitTimers:[...this.#o].map(([e,{duration:t}])=>({name:e.name,duration:t,status:this.#c(e)}))}),this.onRecord=e=>{this.#a.set(e,{start:Date.now(),duration:0})},this.onClear=e=>{this.#a.delete(e)},this.onDone=e=>{let t=this.#a.get(e);t&&(t.duration=Date.now()-t.start)},this.onWait=(e,t)=>{let n=Date.now();t.finally(()=>{this.#o.set(e,{duration:Date.now()-n})}).catch(console.error)},this.onInject=e=>{this.#r.add(e)},this.onRemove=e=>{this.#r.delete(e)},this.onUse=e=>{this.#i.add(e)},this.#s=e=>this.#t.get(e).get(),this.#c=e=>this.#n.get(e).status,this.#t=e,this.#n=t,this.#e=n}#s;#c},ye=class e{#e;#t;#n;#r;constructor(t,n,r){this.produce=t=>t&&Object.keys(t).length?new e(this.#e,this.#t,{...t}):this,this.inject=(e,t)=>{let n=e.create(this.#e.sliceMap);return t!=null&&n.set(t),this.#r?.onInject(e),this},this.remove=e=>(this.#e.remove(e),this.#r?.onRemove(e),this),this.record=e=>(e.create(this.#t.store),this.#r?.onRecord(e),this),this.clearTimer=e=>(this.#t.remove(e),this.#r?.onClear(e),this),this.isInjected=e=>this.#e.has(e),this.isRecorded=e=>this.#t.has(e),this.use=e=>(this.#r?.onUse(e),this.#e.get(e)),this.get=e=>this.use(e).get(),this.set=(e,t)=>this.use(e).set(t),this.update=(e,t)=>this.use(e).update(t),this.timer=e=>this.#t.get(e),this.done=e=>{this.timer(e).done(),this.#r?.onDone(e)},this.wait=e=>{let t=this.timer(e).start();return this.#r?.onWait(e,t),t},this.waitTimers=async e=>{await Promise.all(this.get(e).map(e=>this.wait(e)))},this.#e=t,this.#t=n,this.#n=r,r&&(this.#r=new ve(t,n,r))}get meta(){return this.#n}get inspector(){return this.#r}},be=class{constructor(){this.store=new Map,this.get=e=>{let t=this.store.get(e.id);if(!t)throw ie(e.name);return t},this.remove=e=>{this.store.delete(e.id)},this.has=e=>this.store.has(e.id)}},xe=class{#e;#t;#n;#r;constructor(e,t){this.#e=null,this.#t=null,this.#r=`pending`,this.start=()=>(this.#e??=new Promise((e,t)=>{this.#t=t=>{t instanceof CustomEvent&&t.detail.id===this.#n&&(this.#r=`resolved`,this.#i(),t.stopImmediatePropagation(),e())},this.#a(()=>{this.#r===`pending`&&(this.#r=`rejected`),this.#i(),t(Error(`Timing ${this.type.name} timeout.`))}),this.#r=`pending`,addEventListener(this.type.name,this.#t)}),this.#e),this.done=()=>{let e=new CustomEvent(this.type.name,{detail:{id:this.#n}});dispatchEvent(e)},this.#i=()=>{this.#t&&removeEventListener(this.type.name,this.#t)},this.#a=e=>{setTimeout(()=>{e()},this.type.timeout)},this.#n=Symbol(t.name),this.type=t,e.set(t.id,this)}get status(){return this.#r}#i;#a},Se=class{constructor(e,t=3e3){this.create=e=>new xe(e,this),this.id=Symbol(`Timer-${e}`),this.name=e,this.timeout=t}},Ce=(e,t=3e3)=>new Se(e,t),we={};function Te(e,t){let n=t||we;return Ee(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function Ee(e,t,n){if(Oe(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return De(e.children,t,n)}return Array.isArray(e)?De(e,t,n):``}function De(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Ee(e[i],t,n);return r.join(``)}function Oe(e){return!!(e&&typeof e==`object`)}var ke=document.createElement(`i`);function Ae(e){let t=`&`+e+`;`;ke.innerHTML=t;let n=ke.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function je(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function Me(e,t){return e.length>0?(je(e,e.length,0,t),e):t}var Ne={}.hasOwnProperty;function Pe(e){let t={},n=-1;for(;++n<e.length;)Fe(t,e[n]);return t}function Fe(e,t){let n;for(n in t){let r=(Ne.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Ne.call(r,a)||(r[a]=[]);let e=i[a];Ie(r[a],Array.isArray(e)?e:e?[e]:[])}}}function Ie(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);je(e,0,0,r)}function Le(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function Re(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var ze=Xe(/[A-Za-z]/),Be=Xe(/[\dA-Za-z]/),Ve=Xe(/[#-'*+\--9=?A-Z^-~]/);function He(e){return e!==null&&(e<32||e===127)}var Ue=Xe(/\d/),We=Xe(/[\dA-Fa-f]/),Ge=Xe(/[!-/:-@[-`{-~]/);function k(e){return e!==null&&e<-2}function Ke(e){return e!==null&&(e<0||e===32)}function qe(e){return e===-2||e===-1||e===32}var Je=Xe(/\p{P}|\p{S}/u),Ye=Xe(/\s/);function Xe(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Ze(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return qe(r)?(e.enter(n),s(r)):t(r)}function s(r){return qe(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var Qe={tokenize:$e};function $e(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Ze(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return k(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var et={tokenize:nt},tt={tokenize:rt};function nt(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return je(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(tt,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(tt,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return k(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;je(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function rt(e,t,n){return Ze(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function it(e){if(e===null||Ke(e)||Ye(e))return 1;if(Je(e))return 2}function at(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var ot={name:`attention`,resolveAll:st,tokenize:ct};function st(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};lt(d,-c),lt(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=Me(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=Me(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=Me(l,at(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Me(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=Me(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,je(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function ct(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=it(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=it(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function lt(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var ut={name:`autolink`,tokenize:dt};function dt(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return ze(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||Be(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||Be(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||He(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Ve(t)?(e.consume(t),l):n(t)}function u(e){return Be(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||Be(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var ft={partial:!0,tokenize:pt};function pt(e,t,n){return r;function r(t){return qe(t)?Ze(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||k(e)?t(e):n(e)}}var mt={continuation:{tokenize:gt},exit:_t,name:`blockQuote`,tokenize:ht};function ht(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return qe(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function gt(e,t,n){let r=this;return i;function i(t){return qe(t)?Ze(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(mt,t,n)(r)}}function _t(e){e.exit(`blockQuote`)}var vt={name:`characterEscape`,tokenize:yt};function yt(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Ge(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var bt={name:`characterReference`,tokenize:xt};function xt(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=Be,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=We,u):(e.enter(`characterReferenceValue`),a=7,o=Ue,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===Be&&!Ae(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var St={partial:!0,tokenize:Tt},Ct={concrete:!0,name:`codeFenced`,tokenize:wt};function wt(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),qe(t)?Ze(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||k(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(St,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||k(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):qe(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Ze(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||k(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||k(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&qe(t)?Ze(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||k(t)?e.check(St,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||k(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),qe(t)?Ze(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),qe(t)?Ze(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||k(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Tt(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var Et={name:`codeIndented`,tokenize:Ot},Dt={partial:!0,tokenize:kt};function Ot(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Ze(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):k(t)?e.attempt(Dt,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||k(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function kt(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):k(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Ze(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):k(e)?i(e):n(e)}}var At={name:`codeText`,previous:Mt,resolve:jt,tokenize:Nt};function jt(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Mt(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Nt(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):k(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||k(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Pt=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&Ft(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),Ft(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Ft(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);Ft(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Ft(this.left,t.reverse())}}};function Ft(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function It(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Pt(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Lt(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return je(e,0,1/0,u.slice(0)),!l}function Lt(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var Rt={resolve:Bt,tokenize:Vt},zt={partial:!0,tokenize:Ht};function Bt(e){return It(e),e}function Vt(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):k(t)?e.check(zt,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Ht(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Ze(e,a,`linePrefix`)}function a(i){if(i===null||k(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Ut(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||He(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||k(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||Ke(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||He(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Wt(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):k(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||k(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!qe(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Gt(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):k(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Ze(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||k(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function Kt(e,t){let n;return r;function r(i){return k(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):qe(i)?Ze(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var qt={name:`definition`,tokenize:Yt},Jt={partial:!0,tokenize:Xt};function Yt(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Wt.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=Re(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return Ke(t)?Kt(e,l)(t):l(t)}function l(t){return Ut(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Jt,d,d)(t)}function d(t){return qe(t)?Ze(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||k(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Xt(e,t,n){return r;function r(t){return Ke(t)?Kt(e,i)(t):n(t)}function i(t){return Gt(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return qe(t)?Ze(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||k(e)?t(e):n(e)}}var Zt={name:`hardBreakEscape`,tokenize:Qt};function Qt(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return k(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var $t={name:`headingAtx`,resolve:en,tokenize:tn};function en(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},je(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function tn(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||Ke(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||k(n)?(e.exit(`atxHeading`),t(n)):qe(n)?Ze(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||Ke(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var nn=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),rn=[`pre`,`script`,`style`,`textarea`],an={concrete:!0,name:`htmlFlow`,resolveTo:cn,tokenize:ln},on={partial:!0,tokenize:dn},sn={partial:!0,tokenize:un};function cn(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function ln(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:O):ze(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):ze(a)?(e.consume(a),i=4,r.interrupt?t:O):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:O):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:ee:m):n(i)}function h(t){return ze(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||Ke(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&rn.includes(l)?(i=1,r.interrupt?t(s):ee(s)):nn.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):ee(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||Be(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:ee):n(i)}function v(t){return qe(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||ze(t)?(e.consume(t),b):qe(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||Be(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):qe(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):qe(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||k(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||Ke(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||qe(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||k(t)?ee(t):qe(t)?(e.consume(t),D):n(t)}function ee(t){return t===45&&i===2?(e.consume(t),ie):t===60&&i===1?(e.consume(t),ae):t===62&&i===4?(e.consume(t),ce):t===63&&i===3?(e.consume(t),O):t===93&&i===5?(e.consume(t),se):k(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(on,le,te)(t)):t===null||k(t)?(e.exit(`htmlFlowData`),te(t)):(e.consume(t),ee)}function te(t){return e.check(sn,ne,le)(t)}function ne(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),re}function re(t){return t===null||k(t)?te(t):(e.enter(`htmlFlowData`),ee(t))}function ie(t){return t===45?(e.consume(t),O):ee(t)}function ae(t){return t===47?(e.consume(t),o=``,oe):ee(t)}function oe(t){if(t===62){let n=o.toLowerCase();return rn.includes(n)?(e.consume(t),ce):ee(t)}return ze(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),oe):ee(t)}function se(t){return t===93?(e.consume(t),O):ee(t)}function O(t){return t===62?(e.consume(t),ce):t===45&&i===2?(e.consume(t),O):ee(t)}function ce(t){return t===null||k(t)?(e.exit(`htmlFlowData`),le(t)):(e.consume(t),ce)}function le(n){return e.exit(`htmlFlow`),t(n)}}function un(e,t,n){let r=this;return i;function i(t){return k(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function dn(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(ft,t,n)}}var fn={name:`htmlText`,tokenize:pn};function pn(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):ze(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):ze(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):k(t)?(o=d,ae(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?ie(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):k(t)?(o=h,ae(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?ie(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?ie(t):k(t)?(o=v,ae(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):k(t)?(o=y,ae(t)):(e.consume(t),y)}function b(e){return e===62?ie(e):y(e)}function x(t){return ze(t)?(e.consume(t),S):n(t)}function S(t){return t===45||Be(t)?(e.consume(t),S):C(t)}function C(t){return k(t)?(o=C,ae(t)):qe(t)?(e.consume(t),C):ie(t)}function w(t){return t===45||Be(t)?(e.consume(t),w):t===47||t===62||Ke(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),ie):t===58||t===95||ze(t)?(e.consume(t),E):k(t)?(o=T,ae(t)):qe(t)?(e.consume(t),T):ie(t)}function E(t){return t===45||t===46||t===58||t===95||Be(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),ee):k(t)?(o=D,ae(t)):qe(t)?(e.consume(t),D):T(t)}function ee(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,te):k(t)?(o=ee,ae(t)):qe(t)?(e.consume(t),ee):(e.consume(t),ne)}function te(t){return t===i?(e.consume(t),i=void 0,re):t===null?n(t):k(t)?(o=te,ae(t)):(e.consume(t),te)}function ne(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||Ke(t)?T(t):(e.consume(t),ne)}function re(e){return e===47||e===62||Ke(e)?T(e):n(e)}function ie(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function ae(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),oe}function oe(t){return qe(t)?Ze(e,se,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):se(t)}function se(t){return e.enter(`htmlTextData`),o(t)}}var mn={name:`labelEnd`,resolveAll:vn,resolveTo:yn,tokenize:bn},hn={tokenize:xn},gn={tokenize:Sn},_n={tokenize:Cn};function vn(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&je(e,0,e.length,n),e}function yn(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=Me(s,e.slice(a+1,a+r+3)),s=Me(s,[[`enter`,u,t]]),s=Me(s,at(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=Me(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=Me(s,e.slice(o+1)),s=Me(s,[[`exit`,c,t]]),je(e,a,e.length,s),e}function bn(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(Re(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(hn,u,o?u:d)(t):t===91?e.attempt(gn,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(_n,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function xn(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return Ke(t)?Kt(e,a)(t):a(t)}function a(t){return t===41?u(t):Ut(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return Ke(t)?Kt(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Gt(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return Ke(t)?Kt(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Sn(e,t,n){let r=this;return i;function i(t){return Wt.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(Re(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Cn(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var wn={name:`labelStartImage`,resolveAll:mn.resolveAll,tokenize:Tn};function Tn(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var En={name:`labelStartLink`,resolveAll:mn.resolveAll,tokenize:Dn};function Dn(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var On={name:`lineEnding`,tokenize:kn};function kn(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Ze(e,t,`linePrefix`)}}var An={name:`thematicBreak`,tokenize:jn};function jn(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||k(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),qe(t)?Ze(e,s,`whitespace`)(t):s(t))}}var Mn={continuation:{tokenize:In},exit:Rn,name:`list`,tokenize:Fn},Nn={partial:!0,tokenize:zn},Pn={partial:!0,tokenize:Ln};function Fn(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Ue(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(An,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Ue(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(ft,r.interrupt?n:u,e.attempt(Nn,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return qe(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function In(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(ft,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ze(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!qe(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Pn,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ze(e,e.attempt(Mn,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Ln(e,t,n){let r=this;return Ze(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Rn(e){e.exit(this.containerState.type)}function zn(e,t,n){let r=this;return Ze(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!qe(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var Bn={name:`setextUnderline`,resolveTo:Vn,tokenize:Hn};function Vn(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function Hn(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),qe(t)?Ze(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||k(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var Un={tokenize:Wn};function Wn(e){let t=this,n=e.attempt(ft,r,e.attempt(this.parser.constructs.flowInitial,i,Ze(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Rt,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var Gn={resolveAll:Yn()},Kn=Jn(`string`),qn=Jn(`text`);function Jn(e){return{resolveAll:Yn(e===`text`?Xn:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Yn(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Xn(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var Zn=s({attentionMarkers:()=>ar,contentInitial:()=>$n,disable:()=>or,document:()=>Qn,flow:()=>tr,flowInitial:()=>er,insideSpan:()=>ir,string:()=>nr,text:()=>rr}),Qn={42:Mn,43:Mn,45:Mn,48:Mn,49:Mn,50:Mn,51:Mn,52:Mn,53:Mn,54:Mn,55:Mn,56:Mn,57:Mn,62:mt},$n={91:qt},er={[-2]:Et,[-1]:Et,32:Et},tr={35:$t,42:An,45:[Bn,An],60:an,61:Bn,95:An,96:Ct,126:Ct},nr={38:bt,92:vt},rr={[-5]:On,[-4]:On,[-3]:On,33:wn,38:bt,42:ot,60:[ut,fn],91:En,92:[Zt,vt],93:mn,95:ot,96:At},ir={null:[ot,Gn]},ar={null:[42,95]},or={null:[]};function sr(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=Me(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=at(a,l.events,l),l.events):[]}function f(e,t){return lr(p(e),t)}function p(e){return cr(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){k(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&je(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function cr(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function lr(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
3
|
+
`;break;case-3:o=`\r
|
|
4
|
+
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function ur(e){let t={constructs:Pe([Zn,...(e||{}).extensions||[]]),content:n(Qe),defined:[],document:n(et),flow:n(Un),lazy:{},string:n(Kn),text:n(qn)};return t;function n(e){return n;function n(n){return sr(t,e,n)}}}function dr(e){for(;!It(e););return e}var fr=/[\0\t\n\r]/g;function pr(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(fr.lastIndex=u,c=fr.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var mr=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function hr(e){return e.replace(mr,gr)}function gr(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Le(n.slice(t?2:1),t?16:10)}return Ae(n)||e}function _r(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?yr(e.position):`start`in e||`end`in e?yr(e):`line`in e||`column`in e?vr(e):``}function vr(e){return br(e&&e.line)+`:`+br(e&&e.column)}function yr(e){return vr(e&&e.start)+`-`+vr(e&&e.end)}function br(e){return e&&typeof e==`number`?e:1}var xr={}.hasOwnProperty;function Sr(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),Cr(n)(dr(ur(n).document().write(pr()(e,t,!0))))}function Cr(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(De),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(Se),blockQuote:a(_e),characterEscape:T,characterReference:T,codeFenced:a(ve),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ve,o),codeText:a(ye,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(be),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(xe),hardBreakEscape:a(Ce),hardBreakTrailing:a(Ce),htmlFlow:a(we,o),htmlFlowData:T,htmlText:a(we,o),htmlTextData:T,image:a(Ee),label:o,link:a(De),listItem:a(ke),listItemValue:f,listOrdered:a(Oe,d),listUnordered:a(Oe),paragraph:a(je),reference:ue,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(Se),strong:a(Me),thematicBreak:a(Pe)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:ge,autolinkProtocol:he,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:pe,characterReference:me,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(re),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(ee),hardBreakTrailing:c(ee),htmlFlow:c(te),htmlFlowData:E,htmlText:c(ne),htmlTextData:E,image:c(ae),label:se,labelText:oe,lineEnding:D,link:c(ie),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:de,resourceDestinationString:O,resourceTitleString:ce,resource:le,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};Tr(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];xr.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||Dr).call(a,void 0,e[0])}for(r.position={start:wr(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:wr(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:wr(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Dr).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+_r({start:e.start,end:e.end})+`): it’s not open`);n.position.end=wr(e.end)}function u(){return Te(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Re(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Ne(),n.position={start:wr(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=wr(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=wr(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function ee(){this.data.atHardBreak=!0}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ie(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ae(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function oe(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=hr(t),n.identifier=Re(t).toLowerCase()}function se(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function O(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ce(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function le(){this.data.inReference=void 0}function ue(){this.data.referenceType=`collapsed`}function de(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Re(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function fe(e){this.data.characterReferenceType=e.type}function pe(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Le(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=Ae(t);let i=this.stack[this.stack.length-1];i.value+=r}function me(e){let t=this.stack.pop();t.position.end=wr(e.end)}function he(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ge(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function _e(){return{type:`blockquote`,children:[]}}function ve(){return{type:`code`,lang:null,meta:null,value:``}}function ye(){return{type:`inlineCode`,value:``}}function be(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function xe(){return{type:`emphasis`,children:[]}}function Se(){return{type:`heading`,depth:0,children:[]}}function Ce(){return{type:`break`}}function we(){return{type:`html`,value:``}}function Ee(){return{type:`image`,title:null,url:``,alt:null}}function De(){return{type:`link`,title:null,url:``,children:[]}}function Oe(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function ke(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function je(){return{type:`paragraph`,children:[]}}function Me(){return{type:`strong`,children:[]}}function Ne(){return{type:`text`,value:``}}function Pe(){return{type:`thematicBreak`}}}function wr(e){return{line:e.line,column:e.column,offset:e.offset}}function Tr(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Tr(e,r):Er(e,r)}}function Er(e,t){let n;for(n in t)if(xr.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function Dr(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+_r({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+_r({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+_r({start:t.start,end:t.end})+`) is still open`)}function Or(e){let t=this;t.parser=n;function n(n){return Sr(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}var kr={}.hasOwnProperty;function Ar(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&kr.call(t,e)){let n=String(t[e]);i=kr.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var jr={}.hasOwnProperty;function Mr(e,t){let n=-1,r;if(t.extensions)for(;++n<t.extensions.length;)Mr(e,t.extensions[n]);for(r in t)if(jr.call(t,r))switch(r){case`extensions`:break;case`unsafe`:Nr(e[r],t[r]);break;case`join`:Nr(e[r],t[r]);break;case`handlers`:Pr(e[r],t[r]);break;default:e.options[r]=t[r]}return e}function Nr(e,t){t&&e.push(...t)}function Pr(e,t){t&&Object.assign(e,t)}function Fr(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),Ir);return i(),o}function Ir(e,t,n){return`>`+(n?``:` `)+e}function Lr(e,t){return Rr(e,t.inConstruct,!0)&&!Rr(e,t.notInConstruct,!1)}function Rr(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function zr(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
5
|
+
`&&Lr(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
6
|
+
`}function Br(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Vr(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Hr(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Ur(e,t,n,r){let i=Hr(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(Vr(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Wr);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(Br(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
|
|
7
|
+
`,encode:["`"],...s.current()})),t()}return u+=s.move(`
|
|
8
|
+
`),a&&(u+=s.move(a+`
|
|
9
|
+
`)),u+=s.move(c),l(),u}function Wr(e,t,n){return(n?``:` `)+e}function Gr(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Kr(e,t,n,r){let i=Gr(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
10
|
+
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function qr(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Jr(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Yr(e,t,n){let r=it(e),i=it(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Xr.peek=Zr;function Xr(e,t,n,r){let i=qr(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Yr(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Jr(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Yr(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Jr(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Zr(e,t,n){return n.options.emphasis||`*`}var Qr=(function(e){if(e==null)return ri;if(typeof e==`function`)return ni(e);if(typeof e==`object`)return Array.isArray(e)?$r(e):ei(e);if(typeof e==`string`)return ti(e);throw Error(`Expected function, string, or object as test`)});function $r(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Qr(e[n]);return ni(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function ei(e){let t=e;return ni(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function ti(e){return ni(t);function t(t){return t&&t.type===e}}function ni(e){return t;function t(t,n,r){return!!(ii(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function ri(){return!0}function ii(e){return typeof e==`object`&&!!e&&`type`in e}function ai(e){return e}var oi=[],si=`skip`;function ci(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=Qr(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+ai(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=oi,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=li(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function li(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?oi:[e]}function ui(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),ci(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}function di(e,t){let n=!1;return ui(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&Te(e)&&(t.options.setext||n))}function fi(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(di(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
11
|
+
`,after:`
|
|
12
|
+
`});return r(),t(),o+`
|
|
13
|
+
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
14
|
+
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
15
|
+
`,...a.current()});return/^[\t ]/.test(l)&&(l=Jr(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}pi.peek=mi;function pi(e){return e.value||``}function mi(){return`<`}hi.peek=gi;function hi(e,t,n,r){let i=Gr(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function gi(){return`!`}_i.peek=vi;function _i(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function vi(){return`!`}yi.peek=bi;function yi(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function bi(){return"`"}function xi(e,t){let n=Te(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Si.peek=Ci;function Si(e,t,n,r){let i=Gr(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(xi(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function Ci(e,t,n){return xi(e,n)?`<`:`[`}wi.peek=Ti;function wi(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Ti(){return`[`}function Ei(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Di(e){let t=Ei(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Oi(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function ki(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Ai(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Oi(n):Ei(n),s=e.ordered?o===`.`?`)`:`.`:Di(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),ki(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function ji(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Mi(e,t,n,r){let i=ji(n),a=n.bulletCurrent||Ei(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function Ni(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var Pi=Qr([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function Fi(e,t,n,r){return(e.children.some(function(e){return Pi(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Ii(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Li.peek=Ri;function Li(e,t,n,r){let i=Ii(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Yr(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Jr(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Yr(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Jr(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Ri(e,t,n){return n.options.strong||`*`}function zi(e,t,n,r){return n.safe(e.value,r)}function Bi(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Vi(e,t,n){let r=(ki(n)+(n.options.ruleSpaces?` `:``)).repeat(Bi(n));return n.options.ruleSpaces?r.slice(0,-1):r}var Hi={blockquote:Fr,break:zr,code:Ur,definition:Kr,emphasis:Xr,hardBreak:zr,heading:fi,html:pi,image:hi,imageReference:_i,inlineCode:yi,link:Si,linkReference:wi,list:Ai,listItem:Mi,paragraph:Ni,root:Fi,strong:Li,text:zi,thematicBreak:Vi},Ui=[Wi];function Wi(e,t,n,r){if(t.type===`code`&&Vr(t,r)&&(e.type===`list`||e.type===t.type&&Vr(e,r)))return!1;if(`spread`in n&&typeof n.spread==`boolean`)return e.type===`paragraph`&&(e.type===t.type||t.type===`definition`||t.type===`heading`&&di(t,r))?void 0:+!!n.spread}var Gi=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],Ki=[{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`\r`,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:`
|
|
16
|
+
`,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`!`,after:`\\[`,inConstruct:`phrasing`,notInConstruct:Gi},{character:`"`,inConstruct:`titleQuote`},{atBreak:!0,character:`#`},{character:`#`,inConstruct:`headingAtx`,after:`(?:[\r
|
|
17
|
+
]|$)`},{character:`&`,after:`[#A-Za-z]`,inConstruct:`phrasing`},{character:`'`,inConstruct:`titleApostrophe`},{character:`(`,inConstruct:`destinationRaw`},{before:`\\]`,character:`(`,inConstruct:`phrasing`,notInConstruct:Gi},{atBreak:!0,before:`\\d+`,character:`)`},{character:`)`,inConstruct:`destinationRaw`},{atBreak:!0,character:`*`,after:`(?:[ \r
|
|
18
|
+
*])`},{character:`*`,inConstruct:`phrasing`,notInConstruct:Gi},{atBreak:!0,character:`+`,after:`(?:[ \r
|
|
19
|
+
])`},{atBreak:!0,character:`-`,after:`(?:[ \r
|
|
20
|
+
-])`},{atBreak:!0,before:`\\d+`,character:`.`,after:`(?:[ \r
|
|
21
|
+
]|$)`},{atBreak:!0,character:`<`,after:`[!/?A-Za-z]`},{character:`<`,after:`[!/?A-Za-z]`,inConstruct:`phrasing`,notInConstruct:Gi},{character:`<`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`=`},{atBreak:!0,character:`>`},{character:`>`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`[`},{character:`[`,inConstruct:`phrasing`,notInConstruct:Gi},{character:`[`,inConstruct:[`label`,`reference`]},{character:`\\`,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:`]`,inConstruct:[`label`,`reference`]},{atBreak:!0,character:`_`},{character:`_`,inConstruct:`phrasing`,notInConstruct:Gi},{atBreak:!0,character:"`"},{character:"`",inConstruct:[`codeFencedLangGraveAccent`,`codeFencedMetaGraveAccent`]},{character:"`",inConstruct:`phrasing`,notInConstruct:Gi},{atBreak:!0,character:`~`}];function qi(e){return e.label||!e.identifier?e.label||``:hr(e.identifier)}function Ji(e){if(!e._compiled){let t=(e.atBreak?`[\\r\\n][\\t ]*`:``)+(e.before?`(?:`+e.before+`)`:``);e._compiled=RegExp((t?`(`+t+`)`:``)+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?`\\`:``)+e.character+(e.after?`(?:`+e.after+`)`:``),`g`)}return e._compiled}function Yi(e,t,n){let r=t.indexStack,i=e.children||[],a=[],o=-1,s=n.before,c;r.push(-1);let l=t.createTracker(n);for(;++o<i.length;){let u=i[o],d;if(r[r.length-1]=o,o+1<i.length){let n=t.handle.handlers[i[o+1].type];n&&n.peek&&(n=n.peek),d=n?n(i[o+1],e,t,{before:``,after:``,...l.current()}).charAt(0):``}else d=n.after;a.length>0&&(s===`\r`||s===`
|
|
22
|
+
`)&&u.type===`html`&&(a[a.length-1]=a[a.length-1].replace(/(\r?\n|\r)$/,` `),s=` `,l=t.createTracker(n),l.move(a.join(``)));let f=t.handle(u,e,t,{...l.current(),after:d,before:s});c&&c===f.slice(0,1)&&(f=Jr(c.charCodeAt(0))+f.slice(1));let p=t.attentionEncodeSurroundingInfo;t.attentionEncodeSurroundingInfo=void 0,c=void 0,p&&(a.length>0&&p.before&&s===a[a.length-1].slice(-1)&&(a[a.length-1]=a[a.length-1].slice(0,-1)+Jr(s.charCodeAt(0))),p.after&&(c=d)),l.move(f),a.push(f),s=f.slice(-1)}return r.pop(),a.join(``)}function Xi(e,t,n){let r=t.indexStack,i=e.children||[],a=t.createTracker(n),o=[],s=-1;for(r.push(-1);++s<i.length;){let n=i[s];r[r.length-1]=s,o.push(a.move(t.handle(n,e,t,{before:`
|
|
23
|
+
`,after:`
|
|
24
|
+
`,...a.current()}))),n.type!==`list`&&(t.bulletLastUsed=void 0),s<i.length-1&&o.push(a.move(Zi(n,i[s+1],e,t)))}return r.pop(),o.join(``)}function Zi(e,t,n,r){let i=r.join.length;for(;i--;){let a=r.join[i](e,t,n,r);if(a===!0||a===1)break;if(typeof a==`number`)return`
|
|
25
|
+
`.repeat(1+a);if(a===!1)return`
|
|
26
|
+
|
|
27
|
+
<!---->
|
|
28
|
+
|
|
29
|
+
`}return`
|
|
30
|
+
|
|
31
|
+
`}var Qi=/\r?\n|\r/g;function $i(e,t){let n=[],r=0,i=0,a;for(;a=Qi.exec(e);)o(e.slice(r,a.index)),n.push(a[0]),r=a.index+a[0].length,i++;return o(e.slice(r)),n.join(``);function o(e){n.push(t(e,i,!e))}}function ea(e,t,n){let r=(n.before||``)+(t||``)+(n.after||``),i=[],a=[],o={},s=-1;for(;++s<e.unsafe.length;){let t=e.unsafe[s];if(!Lr(e.stack,t))continue;let n=e.compilePattern(t),a;for(;a=n.exec(r);){let e=`before`in t||!!t.atBreak,n=`after`in t,r=a.index+(e?a[1].length:0);i.includes(r)?(o[r].before&&!e&&(o[r].before=!1),o[r].after&&!n&&(o[r].after=!1)):(i.push(r),o[r]={before:e,after:n})}}i.sort(ta);let c=n.before?n.before.length:0,l=r.length-(n.after?n.after.length:0);for(s=-1;++s<i.length;){let e=i[s];e<c||e>=l||e+1<l&&i[s+1]===e+1&&o[e].after&&!o[e+1].before&&!o[e+1].after||i[s-1]===e-1&&o[e].before&&!o[e-1].before&&!o[e-1].after||(c!==e&&a.push(na(r.slice(c,e),`\\`)),c=e,/[!-/:-@[-`{-~]/.test(r.charAt(e))&&(!n.encode||!n.encode.includes(r.charAt(e)))?a.push(`\\`):(a.push(Jr(r.charCodeAt(e))),c++))}return a.push(na(r.slice(c,l),n.after)),a.join(``)}function ta(e,t){return e-t}function na(e,t){let n=/\\(?=[!-/:-@[-`{-~])/g,r=[],i=[],a=e+t,o=-1,s=0,c;for(;c=n.exec(a);)r.push(c.index);for(;++o<r.length;)s!==r[o]&&i.push(e.slice(s,r[o])),i.push(`\\`),s=r[o];return i.push(e.slice(s)),i.join(``)}function ra(e){let t=e||{},n=t.now||{},r=t.lineShift||0,i=n.line||1,a=n.column||1;return{move:c,current:o,shift:s};function o(){return{now:{line:i,column:a},lineShift:r}}function s(e){r+=e}function c(e){let t=e||``,n=t.split(/\r?\n|\r/g),o=n[n.length-1];return i+=n.length-1,a=n.length===1?a+o.length:1+o.length+r,t}}function ia(e,t){let n=t||{},r={associationId:qi,containerPhrasing:ca,containerFlow:la,createTracker:ra,compilePattern:Ji,enter:a,handlers:{...Hi},handle:void 0,indentLines:$i,indexStack:[],join:[...Ui],options:{},safe:ua,stack:[],unsafe:[...Ki]};Mr(r,n),r.options.tightDefinitions&&r.join.push(sa),r.handle=Ar(`type`,{invalid:aa,unknown:oa,handlers:r.handlers});let i=r.handle(e,void 0,r,{before:`
|
|
32
|
+
`,after:`
|
|
33
|
+
`,now:{line:1,column:1},lineShift:0});return i&&i.charCodeAt(i.length-1)!==10&&i.charCodeAt(i.length-1)!==13&&(i+=`
|
|
34
|
+
`),i;function a(e){return r.stack.push(e),t;function t(){r.stack.pop()}}}function aa(e){throw Error("Cannot handle value `"+e+"`, expected node")}function oa(e){throw Error("Cannot handle unknown node `"+e.type+"`")}function sa(e,t){if(e.type===`definition`&&e.type===t.type)return 0}function ca(e,t){return Yi(e,this,t)}function la(e,t){return Xi(e,this,t)}function ua(e,t){return ea(this,e,t)}function da(e){let t=this;t.compiler=n;function n(n){return ia(n,{...t.data(`settings`),...e,extensions:t.data(`toMarkdownExtensions`)||[]})}}function fa(e){if(e)throw e}var pa=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function ma(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function ha(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?ga(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function ga(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var _a=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=_r(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};_a.prototype.file=``,_a.prototype.name=``,_a.prototype.reason=``,_a.prototype.message=``,_a.prototype.stack=``,_a.prototype.column=void 0,_a.prototype.line=void 0,_a.prototype.ancestors=void 0,_a.prototype.cause=void 0,_a.prototype.fatal=void 0,_a.prototype.place=void 0,_a.prototype.ruleId=void 0,_a.prototype.source=void 0;var va={basename:ya,dirname:ba,extname:xa,join:Sa,sep:`/`};function ya(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Ta(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function ba(e){if(Ta(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function xa(e){Ta(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function Sa(...e){let t=-1,n;for(;++t<e.length;)Ta(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:Ca(n)}function Ca(e){Ta(e);let t=e.codePointAt(0)===47,n=wa(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function wa(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Ta(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Ea={cwd:Da};function Da(){return`/`}function Oa(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function ka(e){if(typeof e==`string`)e=new URL(e);else if(!Oa(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return Aa(e)}function Aa(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var ja=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],Ma=class{constructor(e){let t;t=e?Oa(e)?{path:e}:typeof e==`string`||Ia(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Ea.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<ja.length;){let e=ja[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)ja.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?va.basename(this.path):void 0}set basename(e){Pa(e,`basename`),Na(e,`basename`),this.path=va.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?va.dirname(this.path):void 0}set dirname(e){Fa(this.basename,`dirname`),this.path=va.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?va.extname(this.path):void 0}set extname(e){if(Na(e,`extname`),Fa(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=va.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Oa(e)&&(e=ka(e)),Pa(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?va.basename(this.path,this.extname):void 0}set stem(e){Pa(e,`stem`),Na(e,`stem`),this.path=va.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new _a(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function Na(e,t){if(e&&e.includes(va.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+va.sep+"`")}function Pa(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Fa(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Ia(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var La=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),Ra=l(pa(),1),za={}.hasOwnProperty,Ba=new class e extends La{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=ha()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,Ra.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(Ua(`data`,this.frozen),this.namespace[e]=t,this):za.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Ua(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=Ka(e),n=this.parser||this.Parser;return Va(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),Va(`process`,this.parser||this.Parser),Ha(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=Ka(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);Ja(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),Va(`processSync`,this.parser||this.Parser),Ha(`processSync`,this.compiler||this.Compiler),this.process(e,r),Ga(`processSync`,`process`,t),n;function r(e,r){t=!0,fa(e),n=r}}run(e,t,n){Wa(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=Ka(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),Ga(`runSync`,`run`,n),r;function i(e,t){fa(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=Ka(t),r=this.compiler||this.Compiler;return Ha(`stringify`,r),Wa(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(Ua(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,Ra.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];ma(o)&&ma(r)&&(r=(0,Ra.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function Va(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function Ha(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function Ua(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Wa(e){if(!ma(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function Ga(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ka(e){return qa(e)?e:new Ma(e)}function qa(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function Ja(e){return typeof e==`string`||Ya(e)}function Ya(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}function Xa(e){this.content=e}Xa.prototype={constructor:Xa,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new Xa(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new Xa(n)},addToStart:function(e,t){return new Xa([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Xa(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new Xa(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=Xa.from(e),e.size?new Xa(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=Xa.from(e),e.size?new Xa(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Xa.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},Xa.from=function(e){if(e instanceof Xa)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Xa(t)};function Za(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=Za(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function Qa(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=Qa(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}var A=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return Za(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Qa(this,e,t,n)}findIndex(e){if(e==0)return eo(0,e);if(e==this.size)return eo(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?eo(t+1,i):eo(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};A.empty=new A([],0);var $a={index:0,offset:0};function eo(e,t){return $a.index=e,$a.offset=t,$a}function to(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!to(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!to(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var no=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else !n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&to(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};no.none=[];var ro=class extends Error{},j=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=ao(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(io(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(A.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};j.empty=new j(A.empty,0,0);function io(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(io(a.content,t-i-1,n-i-1)))}function ao(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=ao(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function oo(e,t,n){if(n.openStart>e.depth)throw new ro(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new ro(`Inconsistent open depths`);return so(e,t,n,0)}function so(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=so(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(!n.content.size)return po(a,ho(e,t,r));else if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return po(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=go(n,e);return po(a,mo(e,i,o,t,r))}}function co(e,t){if(!t.type.compatibleContent(e.type))throw new ro(`Cannot join `+t.type.name+` onto `+e.type.name)}function lo(e,t,n){let r=e.node(n);return co(r,t.node(n)),r}function uo(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function fo(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(uo(e.nodeAfter,r),a++));for(let e=a;e<o;e++)uo(i.child(e),r);t&&t.depth==n&&t.textOffset&&uo(t.nodeBefore,r)}function po(e,t){return e.type.checkContent(t),e.copy(t)}function mo(e,t,n,r,i){let a=e.depth>i&&lo(e,t,i+1),o=r.depth>i&&lo(n,r,i+1),s=[];return fo(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(co(a,o),uo(po(a,mo(e,t,n,r,i+1)),s)):(a&&uo(po(a,ho(e,t,i+1)),s),fo(t,n,i,s),o&&uo(po(o,ho(n,r,i+1)),s)),fo(r,null,i,s),new A(s)}function ho(e,t,n){let r=[];return fo(null,e,n,r),e.depth>n&&uo(po(lo(e,t,n+1),ho(e,t,n+1)),r),fo(t,null,n,r),new A(r)}function go(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(A.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var _o=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return no.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new xo(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=bo.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else bo.set(t,r=new vo);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%yo,i}},vo=class{constructor(){this.elts=[],this.i=0}},yo=12,bo=new WeakMap,xo=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},So=Object.create(null),Co=class e{constructor(e,t,n,r=no.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||A.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&to(this.attrs,t||e.defaultAttrs||So)&&no.sameSet(this.marks,n||no.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return j.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new j(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return oo(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return _o.resolveCached(this,e)}resolveNoCache(e){return _o.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),To(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=A.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=no.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!no.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=A.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};Co.prototype.text=void 0;var wo=class e extends Co{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):To(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function To(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var Eo=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Do(t,n);if(r.next==null)return e.empty;let i=Oo(r);r.next&&r.err(`Unexpected trailing text`);let a=Ro(Fo(i));return zo(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return A.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
|
|
35
|
+
`)}};Eo.empty=new Eo(!0);var Do=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function Oo(e){let t=[];do t.push(ko(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function ko(e){let t=[];do t.push(Ao(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function Ao(e){let t=Po(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=Mo(e,t);else break;return t}function jo(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function Mo(e,t){let n=jo(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:jo(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function No(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function Po(e){if(e.eat(`(`)){let t=Oo(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}else if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=No(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function Fo(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function Io(e,t){return t-e}function Lo(e,t){let n=[];return r(t),n.sort(Io);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function Ro(e){let t=Object.create(null);return n(Lo(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);Lo(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new Eo(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(Io);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function zo(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function Bo(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function Vo(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function Ho(e,t,n,r){for(let r in t)if(!(r in e))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function Uo(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new Ko(e,r,t[r]);return n}var Wo=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=Uo(e,n.attrs),this.defaultAttrs=Bo(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Eo.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Vo(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new Co(this,this.computeAttrs(e),A.from(t),no.setFrom(n))}createChecked(e=null,t,n){return t=A.from(t),this.checkContent(t),new Co(this,this.computeAttrs(e),t,no.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=A.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(A.empty,!0);return i?new Co(this,e,t.append(i),no.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Ho(this.attrs,e,`node`,this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:no.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function Go(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var Ko=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?Go(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},qo=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=Uo(e,r.attrs),this.excluded=null;let i=Bo(this.attrs);this.instance=i?new no(this,i):null}create(e=null){return!e&&this.instance?this.instance:new no(this,Vo(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Ho(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},Jo=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=Xa.from(e.nodes),t.marks=Xa.from(e.marks||{}),this.nodes=Wo.compile(this.spec.nodes,this),this.marks=qo.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=Eo.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?Yo(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:Yo(this,n.split(` `))}this.nodeFromJSON=e=>Co.fromJSON(this,e),this.markFromJSON=e=>no.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof Wo))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new wo(n,n.defaultAttrs,e,no.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function Yo(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function Xo(e){return e.tag!=null}function Zo(e){return e.style!=null}var Qo=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(Xo(e))this.tags.push(e);else if(Zo(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new cs(this,t,!1);return n.addAll(e,no.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new cs(this,t,!0);return n.addAll(e,no.none,t.from,t.to),j.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(us(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=ds(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=ds(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},$o={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},es={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ts={ol:!0,ul:!0},ns=1,rs=2,is=4;function as(e,t,n){return t==null?e&&e.whitespace==`pre`?3:n&-5:(t?ns:0)|(t===`full`?rs:0)}var ss=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=no.none,this.match=i||(a&is?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(A.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&ns)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=A.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(A.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!$o.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},cs=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=as(null,t.preserveWhitespace,0)|(n?is:0);i=r?new ss(r.type,r.attrs,no.none,!0,t.topMatch||r.type.contentMatch,a):n?new ss(null,null,no.none,!0,null,a):new ss(e.schema.topNodeType,null,no.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&rs?`full`:this.localPreserveWS||(r.options&ns)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
|
|
36
|
+
`);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;ts.hasOwnProperty(a)&&this.parser.normalizeLists&&ls(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:es.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if($o.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
37
|
+
`),t)}ignoreFallback(e,t){e.nodeName==`BR`&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node)if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=no.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):fs(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=as(e,i,a.options);a.options&is&&a.content.length==0&&(o|=is);let s=no.none;return n=n.filter(t=>(a.type?a.type.allowsMarkType(t.type):fs(t.type,e))?(s=t.addToSet(s),!1):!0),this.nodes.push(new ss(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=ns);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}else{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function ls(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&ts.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function us(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function ds(e){let t={};for(let n in e)t[n]=e[n];return t}function fs(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var ps=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=hs(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){if(e.isText)return hs(t).createTextNode(e.text);let{dom:n,contentDOM:r}=ys(hs(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&ys(hs(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return typeof t==`string`?{dom:e.createTextNode(t)}:ys(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=ms(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return ms(e.marks)}};function ms(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function hs(e){return e.document||window.document}var gs=new WeakMap;function _s(e){let t=gs.get(e);return t===void 0&&gs.set(e,t=vs(e)),t}function vs(e){let t=null;function n(e){if(e&&typeof e==`object`)if(Array.isArray(e))if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t]);else for(let t in e)n(e[t])}return n(e),t}function ys(e,t,n,r){if(t.nodeType==1)return{dom:t};if(t.dom&&t.dom.nodeType==1)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=_s(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}else if(typeof a==`string`)c.appendChild(e.createTextNode(a));else{let{dom:t,contentDOM:i}=ys(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var bs=65535,xs=2**16;function Ss(e,t){return e+t*xs}function Cs(e){return e&bs}function ws(e){return(e-(e&bs))/xs}var Ts=1,Es=2,Ds=4,Os=8,ks=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&Os)>0}get deletedBefore(){return(this.delInfo&5)>0}get deletedAfter(){return(this.delInfo&6)>0}get deletedAcross(){return(this.delInfo&Ds)>0}},As=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=Cs(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+ws(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:Ss(o/3,e-s),f=e==s?Es:e==u?Ts:Ds;return(t<0?e!=s:e!=u)&&(f|=Os),new ks(a,f,d)}r+=l-c}return n?e+r:new ks(e+r,0,null)}touches(e,t){let n=0,r=Cs(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};As.empty=new As([]);var js=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||=[],this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new ks(e,r,null)}},Ms=Object.create(null),Ns=class{getMap(){return As.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=Ms[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Ms)throw RangeError(`Duplicate use of step JSON ID `+e);return Ms[e]=t,t.prototype.jsonID=e,t}},Ps=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof ro)return e.fail(t.message);throw t}}};function Fs(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(Fs(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return A.fromArray(r)}var Is=class e extends Ns{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new j(Fs(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return Ps.fromReplace(e,this.from,this.to,i)}invert(){return new Ls(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};Ns.jsonID(`addMark`,Is);var Ls=class e extends Ns{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new j(Fs(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return Ps.fromReplace(e,this.from,this.to,n)}invert(){return new Is(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};Ns.jsonID(`removeMark`,Ls);var Rs=class e extends Ns{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ps.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Ps.fromReplace(e,this.pos,this.pos+1,new j(A.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new zs(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};Ns.jsonID(`addNodeMark`,Rs);var zs=class e extends Ns{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ps.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Ps.fromReplace(e,this.pos,this.pos+1,new j(A.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Rs(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};Ns.jsonID(`removeNodeMark`,zs);var Bs=class e extends Ns{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Hs(e,this.from,this.to)?Ps.fail(`Structure replace would overwrite content`):Ps.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new As([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?j.empty:new j(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?j.empty:new j(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,j.fromJSON(t,n.slice),!!n.structure)}};Bs.MAP_BIAS=1,Ns.jsonID(`replace`,Bs);var Vs=class e extends Ns{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(Hs(e,this.from,this.gapFrom)||Hs(e,this.gapTo,this.to)))return Ps.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Ps.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?Ps.fromReplace(e,this.from,this.to,n):Ps.fail(`Content does not fit in gap`)}getMap(){return new As([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,j.fromJSON(t,n.slice),n.insert,!!n.structure)}};Ns.jsonID(`replaceAround`,Vs);function Hs(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function Us(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[e])?o.to=d:i.push(o=new Ls(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new Is(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function Ws(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof qo){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new Ls(t.from,t.to,t.style)))}function Gs(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new Bs(s,l,j.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new Ls(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new j(A.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new Bs(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(A.empty,!0);e.replace(s,s,new j(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function Ks(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function qs(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&a.canReplace(o,s,t))return n;if(n==0||a.type.spec.isolating||!Ks(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function Js(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=A.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=A.from(r.node(e).copy(u)),d++):c--;let f=A.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=A.from(i.node(e).copy(f)),p++):l++;e.step(new Vs(c,l,o,s,new j(u.append(f),d,p),u.size-d,!0))}function Ys(e,t,n=null,r=e){let i=Zs(e,t),a=i&&Qs(r,t);return a?i.map(Xs).concat({type:t,attrs:n}).concat(a.map(Xs)):null}function Xs(e){return{type:e,attrs:null}}function Zs(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function Qs(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function $s(e,t,n){let r=A.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=A.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new Vs(i,a,i,a,new j(r,0,0),n.length,!0))}function ec(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&rc(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&nc(e,t,n,a),Gs(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new Vs(c,l,c+1,l-1,new j(A.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&tc(e,t,n,a),!1}})}function tc(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function nc(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
|
|
38
|
+
`))}})}function rc(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function ic(e,t,n,r,i){let a=e.doc.nodeAt(t);if(!a)throw RangeError(`No node at given position`);n||=a.type;let o=n.create(r,null,i||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw RangeError(`Invalid content for node type `+n.name);e.step(new Vs(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new j(A.from(o),0,0),1,!0))}function ac(e,t,n=1,r){let i=e.resolve(t),a=i.depth-n,o=r&&r[r.length-1]||i.parent;if(a<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>a;e--,t--){let n=i.node(e),a=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(a,n.childCount),s=r&&r[t+1];s&&(o=o.replaceChild(0,s.type.create(s.attrs)));let c=r&&r[t]||n;if(!n.canReplace(a+1,n.childCount)||!c.type.validContent(o))return!1}let s=i.indexAfter(a),c=r&&r[0];return i.node(a).canReplaceWith(s,s,c?c.type:i.node(a+1).type)}function oc(e,t,n=1,r){let i=e.doc.resolve(t),a=A.empty,o=A.empty;for(let e=i.depth,t=i.depth-n,s=n-1;e>t;e--,s--){a=A.from(i.node(e).copy(a));let t=r&&r[s];o=A.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new Bs(t,t,new j(a.append(o),n,n),!0))}function sc(e,t){let n=e.resolve(t),r=n.index();return lc(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function cc(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let a=t.child(i),o=a.type==r?e.type.schema.nodes.text:a.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(a.marks))return!1}return n.validEnd}function lc(e,t){return!!(e&&t&&!e.isLeaf&&cc(e,t))}function uc(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(i&&o.inlineContent){let e=o.whitespace==`pre`,t=!!o.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let s=e.steps.length;if(r===!1){let r=e.doc.resolve(t+n);nc(e,r.node(),r.before(),s)}o.inlineContent&&Gs(e,t+n-1,o,a.node().contentMatchAt(a.index()),r==null);let c=e.mapping.slice(s),l=c.map(t-n);if(e.step(new Bs(l,c.map(t+n,-1),j.empty,!0)),r===!0){let t=e.doc.resolve(l);tc(e,t.node(),t.before(),e.steps.length)}return e}function dc(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}function fc(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(n.openStart==0&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,a=r.index(t)+ +(n>0),o=r.node(t),s=!1;if(e==1)s=o.canReplace(a,a,i);else{let e=o.contentMatchAt(a).findWrapping(i.firstChild.type);s=e&&o.canReplaceWith(a,a,e[0])}if(s)return n==0?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function pc(e,t,n=t,r=j.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return mc(i,a,r)?new Bs(t,n,r):new hc(i,a,r).fit()}function mc(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var hc=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=A.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=A.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,a=n.depth,o=r.depth;for(;a&&o&&i.childCount==1;)i=i.firstChild.content,a--,o--;let s=new j(i,a,o);return e>-1?new Vs(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new Bs(n.pos,r.pos,s):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=vc(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let e=this.depth;e>=0;e--){let{type:a,match:o}=this.frontier[e],s,c=null;if(t==1&&(i?o.matchType(i.type)||(c=o.fillBefore(A.from(i),!1)):r&&a.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:e,parent:r,inject:c};if(t==2&&i&&(s=o.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:e,parent:r,wrap:s};if(r&&o.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=vc(e,t);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new j(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=vc(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new j(gc(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new j(gc(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let a=this.unplaced,o=n?n.content:a.content,s=a.openStart-e,c=0,l=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)l.push(r.child(e));u=u.matchFragment(r)}let f=o.size+e-(a.content.size-a.openEnd);for(;c<o.childCount;){let e=o.child(c),t=u.matchType(e.type);if(!t)break;c++,(c>1||s==0||e.content.size)&&(u=t,l.push(yc(e.mark(d.allowedMarks(e.marks)),c==1?s:0,c==o.childCount?f:-1)))}let p=c==o.childCount;p||(f=-1),this.placed=_c(this.placed,t,A.from(l)),this.frontier[t].match=u,p&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=o;e<f;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?e==0?j.empty:new j(gc(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new j(gc(a.content,e,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!bc(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){scan:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=bc(e,t,r,n,i);if(a){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=bc(e,n,r,t,!0);if(!i||i.childCount)continue scan}return{depth:t,fit:a,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=_c(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=_c(this.placed,this.depth,A.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(A.empty,!0);e.childCount&&(this.placed=_c(this.placed,this.frontier.length,e))}};function gc(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(gc(e.firstChild.content,t-1,n)))}function _c(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(_c(e.lastChild.content,t-1,n)))}function vc(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function yc(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,yc(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(A.empty,!0)))),e.copy(r)}function bc(e,t,n,r,i){let a=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;let s=r.fillBefore(a.content,!0,o);return s&&!xc(n,a.content,o)?s:null}function xc(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function Sc(e){return e.spec.defining||e.spec.definingForContent}function Cc(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),a=e.doc.resolve(n);if(mc(i,a,r))return e.step(new Bs(t,n,r));let o=Dc(i,a);o[o.length-1]==0&&o.pop();let s=-(i.depth+1);o.unshift(s);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;o.indexOf(e)>-1?s=e:i.before(e)==t&&o.splice(1,0,-e)}let c=o.indexOf(s),l=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(l.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=l[e],n=Sc(t.type);if(n&&!t.sameMarkup(i.node(Math.abs(s)-1)))u=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let s=(t+u+1)%(r.openStart+1),d=l[s];if(d)for(let t=0;t<o.length;t++){let l=o[(t+c)%o.length],u=!0;l<0&&(u=!1,l=-l);let f=i.node(l-1),p=i.index(l-1);if(f.canReplaceWith(p,p,d.type,d.marks))return e.replace(i.before(l),u?a.after(l):n,new j(wc(r.content,0,r.openStart,s),s,r.openEnd))}}let d=e.steps.length;for(let s=o.length-1;s>=0&&(e.replace(t,n,r),!(e.steps.length>d));s--){let e=o[s];e<0||(t=i.before(e),n=a.after(e))}}function wc(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(wc(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(A.empty,!0))}return e}function Tc(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=dc(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new j(A.from(r),0,0))}function Ec(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let a=r.sharedDepth(n),o=!1;for(let e=r.depth;e>a;e--)r.node(e).type.spec.isolating&&(o=!0);for(let e=i.depth;e>a;e--)i.node(e).type.spec.isolating&&(o=!0);if(!o){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=i.depth;e>0&&n==i.start(e);e--)n=i.before(e);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let a=Dc(r,i);for(let t=0;t<a.length;t++){let n=a[t],o=t==a.length-1;if(o&&n==0||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(o||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return e.delete(r.before(a),n);e.delete(t,n)}function Dc(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}var Oc=class e extends Ns{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ps.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return Ps.fromReplace(e,this.pos,this.pos+1,new j(A.from(r),0,+!t.isLeaf))}getMap(){return As.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:`attr`,pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!=`number`||typeof n.attr!=`string`)throw RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}};Ns.jsonID(`attr`,Oc);var kc=class e extends Ns{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return Ps.ok(n)}getMap(){return As.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:`docAttr`,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}};Ns.jsonID(`docAttr`,kc);var Ac=class extends Error{};Ac=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},Ac.prototype=Object.create(Error.prototype),Ac.prototype.constructor=Ac,Ac.prototype.name=`TransformError`;var jc=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new js}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Ac(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,i,a)=>{e=Math.min(e,i),t=Math.max(t,a)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=j.empty){let r=pc(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new j(A.from(n),0,0))}delete(e,t){return this.replace(e,t,j.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return Cc(this,e,t,n),this}replaceRangeWith(e,t,n){return Tc(this,e,t,n),this}deleteRange(e,t){return Ec(this,e,t),this}lift(e,t){return Js(this,e,t),this}join(e,t=1){return uc(this,e,t),this}wrap(e,t){return $s(this,e,t),this}setBlockType(e,t=e,n,r=null){return ec(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return ic(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new Oc(e,t,n)),this}setDocAttribute(e,t){return this.step(new kc(e,t)),this}addNodeMark(e,t){return this.step(new Rs(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof no)t.isInSet(n.marks)&&this.step(new zs(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new zs(e,i)),r=i.removeFromSet(r);for(let e=a.length-1;e>=0;e--)this.step(a[e])}return this}split(e,t=1,n){return oc(this,e,t,n),this}addMark(e,t,n){return Us(this,e,t,n),this}removeMark(e,t,n){return Ws(this,e,t,n),this}clearIncompatible(e,t,n){return Gs(this,e,t,n),this}},Mc=Object.create(null),Nc=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new Pc(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=j.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:s,$to:c}=a[o],l=e.mapping.slice(i);e.replaceRange(l.map(s.pos),l.map(c.pos),o?j.empty:t),o==0&&Hc(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n),c=s.map(a.pos),l=s.map(o.pos);i?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),Hc(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new M(e):Vc(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?Vc(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):Vc(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new zc(e.node(0))}static atStart(e){return Vc(e,e,0,0,1)||new zc(e)}static atEnd(e){return Vc(e,e,e.content.size,e.childCount,-1)||new zc(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=Mc[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Mc)throw RangeError(`Duplicate use of selection JSON ID `+e);return Mc[e]=t,t.prototype.jsonID=e,t}getBookmark(){return M.between(this.$anchor,this.$head).getBookmark()}};Nc.prototype.visible=!0;var Pc=class{constructor(e,t){this.$from=e,this.$to=t}},Fc=!1;function Ic(e){!Fc&&!e.parent.inlineContent&&(Fc=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}var M=class e extends Nc{constructor(e,t=e){Ic(e),Ic(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return Nc.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=j.empty){if(super.replace(e,t),t==j.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Lc(this.anchor,this.head)}toJSON(){return{type:`text`,anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!=`number`||typeof n.head!=`number`)throw RangeError(`Invalid input for TextSelection.fromJSON`);return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=Nc.findFrom(n,r,!0)||Nc.findFrom(n,-r,!0);if(e)n=e.$head;else return Nc.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(Nc.findFrom(t,-r,!0)||Nc.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}};Nc.jsonID(`text`,M);var Lc=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return M.between(e.resolve(this.anchor),e.resolve(this.head))}},N=class e extends Nc{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),a=t.resolve(i);return r?Nc.near(a):new e(a)}content(){return new j(A.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:`node`,anchor:this.anchor}}getBookmark(){return new Rc(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!=`number`)throw RangeError(`Invalid input for NodeSelection.fromJSON`);return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};N.prototype.visible=!1,Nc.jsonID(`node`,N);var Rc=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Lc(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&N.isSelectable(n)?new N(t):Nc.near(t)}},zc=class e extends Nc{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=j.empty){if(t==j.empty){e.delete(0,e.doc.content.size);let t=Nc.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:`all`}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return Bc}};Nc.jsonID(`all`,zc);var Bc={map(){return this},resolve(e){return new zc(e)}};function Vc(e,t,n,r,i,a=!1){if(t.inlineContent)return M.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(!r.isAtom){let t=Vc(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&N.isSelectable(r))return N.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function Hc(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Bs||i instanceof Vs))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(Nc.near(e.doc.resolve(o),n))}var Uc=1,Wc=2,Gc=4,Kc=class extends jc{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw RangeError(`Selection passed to setSelection must point at the current document`);return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Uc)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&Uc)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Wc,this}ensureMarks(e){return no.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Wc)>0}addStep(e,t){super.addStep(e,t),this.updated&=-3,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||no.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(n??=t,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(Nc.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e==`string`?e:e.key]=t,this}getMeta(e){return this.meta[typeof e==`string`?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Gc,this}get scrolledIntoView(){return(this.updated&Gc)>0}};function qc(e,t){return!t||!e?e:e.bind(t)}var Jc=class{constructor(e,t,n){this.name=e,this.init=qc(t.init,n),this.apply=qc(t.apply,n)}},Yc=[new Jc(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Jc(`selection`,{init(e,t){return e.selection||Nc.atStart(t.doc)},apply(e){return e.selection}}),new Jc(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Jc(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],Xc=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Yc.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError(`Adding different instances of a keyed plugin (`+e.key+`)`);this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new Jc(e.key,e.spec.state,e))})}},Zc=class e{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let a=0;a<this.config.plugins.length;a++){let o=this.config.plugins[a];if(o.spec.appendTransaction){let s=r?r[a].n:0,c=r?r[a].state:this,l=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,c,n);if(l&&n.filterTransaction(l,a)){if(l.setMeta(`appendedTransaction`,e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<a?{state:n,n:t.length}:{state:this,n:0})}t.push(l),n=n.applyInner(l),i=!0}r&&(r[a]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError(`Applying a mismatched transaction`);let n=new e(this.config),r=this.config.fields;for(let e=0;e<r.length;e++){let i=r[e];n[i.name]=i.apply(t,this[i.name],this,n)}return n}get tr(){return new Kc(this)}static create(t){let n=new Xc(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n);for(let e=0;e<n.fields.length;e++)r[n.fields[e].name]=n.fields[e].init(t,r);return r}reconfigure(t){let n=new Xc(this.schema,t.plugins),r=n.fields,i=new e(n);for(let e=0;e<r.length;e++){let n=r[e].name;i[n]=this.hasOwnProperty(n)?this[n]:r[e].init(t,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&typeof e==`object`)for(let n in e){if(n==`doc`||n==`selection`)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(t,n,r){if(!n)throw RangeError(`Invalid input for EditorState.fromJSON`);if(!t.schema)throw RangeError(`Required config field 'schema' missing`);let i=new Xc(t.schema,t.plugins),a=new e(i);return i.fields.forEach(e=>{if(e.name==`doc`)a.doc=Co.fromJSON(t.schema,n.doc);else if(e.name==`selection`)a.selection=Nc.fromJSON(a.doc,n.selection);else if(e.name==`storedMarks`)n.storedMarks&&(a.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let i in r){let o=r[i],s=o.spec.state;if(o.key==e.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,i)){a[e.name]=s.fromJSON.call(o,t,n[i],a);return}}a[e.name]=e.init(t,a)}}),a}};function Qc(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=Qc(i,t,{})),n[r]=i}return n}var $c=class{constructor(e){this.spec=e,this.props={},e.props&&Qc(e.props,this,this.props),this.key=e.key?e.key.key:tl(`plugin`)}getState(e){return e[this.key]}},el=Object.create(null);function tl(e){return e in el?e+`$`+ ++el[e]:(el[e]=0,e+`$`)}var nl=class{constructor(e=`key`){this.key=tl(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}},rl=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function il(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}var al=(e,t,n)=>{let r=il(e,n);if(!r)return!1;let i=ul(r);if(!i){let n=r.blockRange(),i=n&&qs(n);return i==null?!1:(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if(wl(e,i,t,-1))return!0;if(r.parent.content.size==0&&(cl(a,`end`)||N.isSelectable(a)))for(let n=r.depth;;n--){let o=pc(e.doc,r.before(n),r.after(n),j.empty);if(o&&o.slice.size<o.to-o.from){if(t){let n=e.tr.step(o);n.setSelection(cl(a,`end`)?Nc.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):N.create(n.doc,i.pos-a.nodeSize)),t(n.scrollIntoView())}return!0}if(n==1||r.node(n-1).childCount>1)break}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-a.nodeSize,i.pos).scrollIntoView()),!0):!1},ol=(e,t,n)=>{let r=il(e,n);if(!r)return!1;let i=ul(r);return i?sl(e,i,t):!1};function sl(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let a=t.nodeAfter,o=t.pos+1;for(;!a.isTextblock;o++){if(a.type.spec.isolating)return!1;let e=a.firstChild;if(!e)return!1;a=e}let s=pc(e.doc,i,o,j.empty);if(!s||s.from!=i||s instanceof Bs&&s.slice.size>=o-i)return!1;if(n){let t=e.tr.step(s);t.setSelection(M.create(t.doc,i)),n(t.scrollIntoView())}return!0}function cl(e,t,n=!1){for(let r=e;r;r=t==`start`?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}var ll=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`backward`,e):r.parentOffset>0)return!1;a=ul(r)}let o=a&&a.nodeBefore;return!o||!N.isSelectable(o)?!1:(t&&t(e.tr.setSelection(N.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function ul(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function dl(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}var fl=(e,t,n)=>{let r=dl(e,n);if(!r)return!1;let i=ml(r);if(!i)return!1;let a=i.nodeAfter;if(wl(e,i,t,1))return!0;if(r.parent.content.size==0&&(cl(a,`start`)||N.isSelectable(a))){let n=pc(e.doc,r.before(),r.after(),j.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(cl(a,`start`)?Nc.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):N.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+a.nodeSize).scrollIntoView()),!0):!1},pl=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`forward`,e):r.parentOffset<r.parent.content.size)return!1;a=ml(r)}let o=a&&a.nodeAfter;return!o||!N.isSelectable(o)?!1:(t&&t(e.tr.setSelection(N.create(e.doc,a.pos)).scrollIntoView()),!0)};function ml(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}var hl=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
|
|
39
|
+
`).scrollIntoView()),!0)};function gl(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var _l=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),a=n.indexAfter(-1),o=gl(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(Nc.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},vl=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof zc||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=gl(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(n,a.createAndFill());o.setSelection(M.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},yl=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(ac(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&qs(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function bl(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof N&&t.selection.node.isBlock)return!r.parentOffset||!ac(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let a=[],o,s,c=!1,l=!1;for(let t=r.depth;;t--)if(r.node(t).isBlock){c=r.end(t)==r.pos+(r.depth-t),l=r.start(t)==r.pos-(r.depth-t),s=gl(r.node(t-1).contentMatchAt(r.indexAfter(t-1)));let n=e&&e(i.parent,c,r);a.unshift(n||(c&&s?{type:s}:null)),o=t;break}else{if(t==1)return!1;a.unshift(null)}let u=t.tr;(t.selection instanceof M||t.selection instanceof zc)&&u.deleteSelection();let d=u.mapping.map(r.pos),f=ac(u.doc,d,a.length,a);if(f||=(a[0]=s?{type:s}:null,ac(u.doc,d,a.length,a)),!f)return!1;if(u.split(d,a.length,a),!c&&l&&r.node(o).type!=s){let e=u.mapping.map(r.before(o)),t=u.doc.resolve(e);s&&r.node(o-1).canReplaceWith(t.index(),t.index()+1,s)&&u.setNodeMarkup(u.mapping.map(r.before(o)),s)}return n&&n(u.scrollIntoView()),!0}}var xl=bl(),Sl=(e,t)=>(t&&t(e.tr.setSelection(new zc(e.doc))),!0);function Cl(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,a=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(i.isTextblock||sc(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function wl(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&Cl(e,t,n))return!0;let l=!c&&t.parent.canReplace(t.index(),t.index()+1);if(l&&(o=(s=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&s.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,s=A.empty;for(let e=o.length-1;e>=0;e--)s=A.from(o[e].create(null,s));s=A.from(i.copy(s));let c=e.tr.step(new Vs(t.pos-1,r,t.pos,r,new j(s,1,0),o.length,!0)),l=c.doc.resolve(r+2*o.length);l.nodeAfter&&l.nodeAfter.type==i.type&&sc(c.doc,l.pos)&&c.join(l.pos),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:Nc.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&qs(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&cl(a,`start`,!0)&&cl(i,`end`)){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let s=a,c=1;for(;!s.isTextblock;s=s.firstChild)c++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(n){let r=A.empty;for(let e=o.length-1;e>=0;e--)r=A.from(o[e].copy(r));n(e.tr.step(new Vs(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new j(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Tl(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(n&&n(t.tr.setSelection(M.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}var El=Tl(-1),Dl=Tl(1);function Ol(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a),s=o&&Ys(o,e,t);return s?(r&&r(n.tr.wrap(o,s).scrollIntoView()),!0):!1}}function kl(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(a,o,(r,a)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)i=!0;else{let t=n.doc.resolve(a),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];i.setBlockType(a,o,e,t)}r(i.scrollIntoView())}return!0}}function Al(e,t,n,r){for(let i=0;i<t.length;i++){let{$from:a,$to:o}=t[i],s=a.depth==0?e.inlineContent&&e.type.allowsMarkType(n):!1;if(e.nodesBetween(a.pos,o.pos,(e,t)=>{if(s||!r&&e.isAtom&&e.isInline&&t>=a.pos&&t+e.nodeSize<=o.pos)return!1;s=e.inlineContent&&e.type.allowsMarkType(n)}),s)return!0}return!1}function jl(e){let t=[];for(let n=0;n<e.length;n++){let{$from:r,$to:i}=e[n];r.doc.nodesBetween(r.pos,i.pos,(e,n)=>{if(e.isAtom&&e.content.size&&e.isInline&&n>=r.pos&&n+e.nodeSize<=i.pos)return n+1>r.pos&&t.push(new Pc(r,r.doc.resolve(n+1))),r=r.doc.resolve(n+1+e.content.size),!1}),r.pos<i.pos&&t.push(new Pc(r,i))}return t}function Ml(e,t=null,n){let r=(n&&n.removeWhenPresent)!==!1,i=(n&&n.enterInlineAtoms)!==!1,a=!(n&&n.includeWhitespace);return function(n,o){let{empty:s,$cursor:c,ranges:l}=n.selection;if(s&&!c||!Al(n.doc,l,e,i))return!1;if(o)if(c)e.isInSet(n.storedMarks||c.marks())?o(n.tr.removeStoredMark(e)):o(n.tr.addStoredMark(e.create(t)));else{let s,c=n.tr;i||(l=jl(l)),s=r?!l.some(t=>n.doc.rangeHasMark(t.$from.pos,t.$to.pos,e)):!l.every(t=>{let n=!1;return c.doc.nodesBetween(t.$from.pos,t.$to.pos,(r,i,a)=>{if(n)return!1;n=!e.isInSet(r.marks)&&!!a&&a.type.allowsMarkType(e)&&!(r.isText&&/^\s*$/.test(r.textBetween(Math.max(0,t.$from.pos-i),Math.min(r.nodeSize,t.$to.pos-i))))}),!n});for(let n=0;n<l.length;n++){let{$from:r,$to:i}=l[n];if(!s)c.removeMark(r.pos,i.pos,e);else{let n=r.pos,o=i.pos,s=r.nodeAfter,l=i.nodeBefore,u=a&&s&&s.isText?/^\s*/.exec(s.text)[0].length:0,d=a&&l&&l.isText?/\s*$/.exec(l.text)[0].length:0;n+u<o&&(n+=u,o-=d),c.addMark(n,o,e.create(t))}}o(c.scrollIntoView())}return!0}}function Nl(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}var Pl=Nl(rl,al,ll),Fl=Nl(rl,fl,pl),Il={Enter:Nl(hl,vl,yl,xl),"Mod-Enter":_l,Backspace:Pl,"Mod-Backspace":Pl,"Shift-Backspace":Pl,Delete:Fl,"Mod-Delete":Fl,"Mod-a":Sl},Ll={"Ctrl-h":Il.Backspace,"Alt-Backspace":Il[`Mod-Backspace`],"Ctrl-d":Il.Delete,"Ctrl-Alt-Backspace":Il[`Mod-Delete`],"Alt-Delete":Il[`Mod-Delete`],"Alt-d":Il[`Mod-Delete`],"Ctrl-a":El,"Ctrl-e":Dl};for(let e in Il)Ll[e]=Il[e];var Rl=(typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform&&os.platform()==`darwin`)?Ll:Il,zl=class{constructor(e,t,n={}){this.match=e,this.match=e,this.handler=typeof t==`string`?Bl(t):t,this.undoable=n.undoable!==!1,this.inCode=n.inCode||!1,this.inCodeMark=n.inCodeMark!==!1}};function Bl(e){return function(t,n,r,i){let a=e;if(n[1]){let e=n[0].lastIndexOf(n[1]);a+=n[0].slice(e+n[1].length),r+=e;let t=r-i;t>0&&(a=n[0].slice(e-t,e)+a,r=i)}return t.tr.insertText(a,r,i)}}var Vl=(e,t)=>{let n=e.plugins;for(let r=0;r<n.length;r++){let i=n[r],a;if(i.spec.isInputRules&&(a=i.getState(e))){if(t){let n=e.tr,r=a.transform;for(let e=r.steps.length-1;e>=0;e--)n.step(r.steps[e].invert(r.docs[e]));if(a.text){let t=n.doc.resolve(a.from).marks();n.replaceWith(a.from,a.to,e.schema.text(a.text,t))}else n.delete(a.from,a.to);t(n)}return!0}}return!1};new zl(/--$/,`—`,{inCodeMark:!1}),new zl(/\.\.\.$/,`…`,{inCodeMark:!1}),new zl(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,`“`,{inCodeMark:!1}),new zl(/"$/,`”`,{inCodeMark:!1}),new zl(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,`‘`,{inCodeMark:!1}),new zl(/'$/,`’`,{inCodeMark:!1});function Hl(e,t,n=null,r){return new zl(e,(e,i,a,o)=>{let s=n instanceof Function?n(i):n,c=e.tr.delete(a,o),l=c.doc.resolve(a).blockRange(),u=l&&Ys(l,t,s);if(!u)return null;c.wrap(l,u);let d=c.doc.resolve(a-1).nodeBefore;return d&&d.type==t&&sc(c.doc,a-1)&&(!r||r(i,d))&&c.join(a-1),c})}function Ul(e,t,n=null){return new zl(e,(e,r,i,a)=>{let o=e.doc.resolve(i),s=n instanceof Function?n(r):n;return o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t)?e.tr.delete(i,a).setBlockType(i,i,t,s):null})}var Wl=typeof navigator<`u`?navigator:null,Gl=typeof document<`u`?document:null,Kl=Wl&&Wl.userAgent||``,ql=/Edge\/(\d+)/.exec(Kl),Jl=/MSIE \d/.exec(Kl),Yl=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Kl),Xl=!!(Jl||Yl||ql);Jl?document.documentMode:Yl?+Yl[1]:ql&&+ql[1],!Xl&&/gecko\/(\d+)/i.test(Kl)&&+(/Firefox\/(\d+)/.exec(Kl)||[0,0])[1];var Zl=!Xl&&/Chrome\/(\d+)/.exec(Kl),Ql=!!Zl;Zl&&+Zl[1],!Xl&&Wl&&/Apple Computer/.test(Wl.vendor)&&(/Mobile\/\w+/.test(Kl)||Wl&&Wl.maxTouchPoints>2)||Wl&&/Mac/.test(Wl.platform);var $l=/Android \d/.test(Kl);Gl&&`webkitFontSmoothing`in Gl.documentElement.style&&+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1];function eu(e,t,n,r,i,a){if(e.composing)return!1;let o=e.state,s=o.doc.resolve(t);if(s.parent.type.spec.code)return!1;let c=s.parent.textBetween(Math.max(0,s.parentOffset-500),s.parentOffset,void 0,``)+r;for(let s of i){let i=s,l=i.match.exec(c),u=l&&l[0]&&i.handler(o,l,t-(l[0].length-r.length),n);if(u)return i.undoable!==!1&&u.setMeta(a,{transform:u,from:t,to:n,text:r}),e.dispatch(u),!0}return!1}var tu=new nl(`MILKDOWN_CUSTOM_INPUTRULES`);function nu({rules:e}){let t=new $c({key:tu,isInputRules:!0,state:{init(){return null},apply(e,t){return e.getMeta(this)||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput(n,r,i,a){return eu(n,r,i,a,e,t)},handleDOMEvents:{compositionend:n=>(setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&eu(n,r.pos,r.pos,``,e,t)}),!1),keydown:(e,t)=>!($l&&Ql&&t.key===`Enter`)||e.composing?!1:e.someProp(`handleKeyDown`,n=>n(e,t))?(t.preventDefault(),!0):!1},handleKeyDown(n,r){if(r.key!==`Enter`)return!1;let{$cursor:i}=n.state.selection;return i?eu(n,i.pos,i.pos,`
|
|
40
|
+
`,e,t):!1}}});return t}function ru(e,t,n={}){return new zl(e,(e,r,i,a)=>{var o;let{tr:s}=e,c=r[r.length-1],l=r[0],u=[],d,f={group:c,fullMatch:l,start:i,end:a},p=n.updateCaptured?.call(n,f);if(Object.assign(f,p),{group:c,fullMatch:l,start:i,end:a}=f,l===null||c?.trim()===``)return null;if(c){let e=l.search(/\S/),f=i+l.indexOf(c),p=f+c.length;u=s.storedMarks??[],p<a&&s.delete(p,a),f>i&&s.delete(i+e,f),d=i+e+c.length;let m=n.getAttr?.call(n,r);s.addMark(i,d,t.create(m)),s.setStoredMarks(u),(o=n.beforeDispatch)==null||o.call(n,{match:r,start:i,end:a,tr:s})}return s})}var iu=Object.defineProperty,au=Object.defineProperties,ou=Object.getOwnPropertyDescriptors,su=Object.getOwnPropertySymbols,cu=Object.prototype.hasOwnProperty,lu=Object.prototype.propertyIsEnumerable,uu=(e,t,n)=>t in e?iu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,du=(e,t)=>{for(var n in t||={})cu.call(t,n)&&uu(e,n,t[n]);if(su)for(var n of su(t))lu.call(t,n)&&uu(e,n,t[n]);return e},fu=(e,t)=>au(e,ou(t));function pu(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function mu(e,t,n){let r=e.state.doc.content.size,i=pu(t,0,r),a=pu(n,0,r),o=e.coordsAtPos(i),s=e.coordsAtPos(a,-1),c=Math.min(o.top,s.top),l=Math.max(o.bottom,s.bottom),u=Math.min(o.left,s.left),d=Math.max(o.right,s.right),f={top:c,bottom:l,left:u,right:d,width:d-u,height:l-c,x:u,y:c};return fu(du({},f),{toJSON:()=>f})}function hu(e){return Object.assign(Object.create(e),e).setTime(Date.now())}function gu(e,t){return Array.isArray(e)&&e.includes(t.type)||t.type===e}function _u(e){if(e.content.childCount===1){let t=e.content.firstChild;if(t?.type.name===`text`&&t.marks.length===0)return t;if(t?.type.name===`paragraph`&&t.childCount===1){let e=t.firstChild;if(e?.type.name===`text`&&e.marks.length===0)return e}}return!1}function vu(e,t=!0){let n=[];return e.descendants((e,r)=>{if(n.push({node:e,pos:r}),!t)return!1}),n}function yu(e){return(t,n)=>vu(t,n).filter(t=>e(t.node))}function bu(e){return t=>{for(let n=t.depth;n>0;--n){let r=t.node(n);if(e(r))return{from:t.before(n),to:t.after(n),node:r}}}}function xu(e,t){return bu(e=>e.type===t)(e)}function Su(e,t){let n=t.nodes[e];if(!n)throw le(`node`,e);return n}function Cu(e){return t=>{for(let n=t.depth;n>0;n--){let r=t.node(n);if(e(r))return{pos:t.before(n),start:t.start(n),depth:n,node:r}}}}function wu(e,t){if(!(e instanceof N))return;let{node:n,$from:r}=e;if(gu(t,n))return{node:n,pos:r.pos,start:r.start(r.depth),depth:r.depth}}for(var Tu=(e,t)=>{let{selection:n,doc:r}=e;if(n instanceof N)return{hasNode:n.node.type===t,pos:n.from,target:n.node};let{from:i,to:a}=n,o=!1,s=-1,c=null;return r.nodesBetween(i,a,(e,n)=>c?!1:e.type===t?(o=!0,s=n,c=e,!1):!0),{hasNode:o,pos:s,target:c}},Eu={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},Du={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},Ou=typeof navigator<`u`&&/Mac/.test(navigator.platform),ku=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Au=0;Au<10;Au++)Eu[48+Au]=Eu[96+Au]=String(Au);for(var Au=1;Au<=24;Au++)Eu[Au+111]=`F`+Au;for(var Au=65;Au<=90;Au++)Eu[Au]=String.fromCharCode(Au+32),Du[Au]=String.fromCharCode(Au);for(var ju in Eu)Du.hasOwnProperty(ju)||(Du[ju]=Eu[ju]);function Mu(e){var t=!(Ou&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||ku&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?Du:Eu)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}var Nu=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Pu=typeof navigator<`u`&&/Win/.test(navigator.platform);function Fu(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e++){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))Nu?o=!0:i=!0;else throw Error(`Unrecognized modifier name: `+n)}return r&&(n=`Alt-`+n),i&&(n=`Ctrl-`+n),o&&(n=`Meta-`+n),a&&(n=`Shift-`+n),n}function Iu(e){let t=Object.create(null);for(let n in e)t[Fu(n)]=e[n];return t}function Lu(e,t,n=!0){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n&&t.shiftKey&&(e=`Shift-`+e),e}function Ru(e){return new $c({props:{handleKeyDown:zu(e)}})}function zu(e){let t=Iu(e);return function(e,n){let r=Mu(n),i,a=t[Lu(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[Lu(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(Pu&&n.ctrlKey&&n.altKey)&&(i=Eu[n.keyCode])&&i!=r){let r=t[Lu(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var Bu=class{},Vu=class{constructor(){this.elements=[],this.size=()=>this.elements.length,this.top=()=>this.elements.at(-1),this.push=e=>{this.top()?.push(e)},this.open=e=>{this.elements.push(e)},this.close=()=>{let e=this.elements.pop();if(!e)throw se();return e}}},Hu=class e extends Bu{constructor(e,t,n){super(),this.type=e,this.content=t,this.attrs=n}push(e,...t){this.content.push(e,...t)}pop(){return this.content.pop()}static create(t,n,r){return new e(t,n,r)}},Uu=class extends Vu{#e;static{this.create=(e,t)=>{let n=new this(e);return e=>(n.run(t,e),n.toDoc())}}constructor(e){super(),this.#e=no.none,this.#t=e=>e.isText,this.#n=(e,t)=>{if(this.#t(e)&&this.#t(t)&&no.sameSet(e.marks,t.marks))return this.schema.text(e.text+t.text,e.marks)},this.#r=e=>{let t=Object.values({...this.schema.nodes,...this.schema.marks}).find(t=>t.spec.parseMarkdown.match(e));if(!t)throw O(e);return t},this.#i=e=>{let t=this.#r(e);t.spec.parseMarkdown.runner(this,e,t)},this.injectRoot=(e,t,n)=>(this.openNode(t,n),this.next(e.children),this),this.openNode=(e,t)=>(this.open(Hu.create(e,[],t)),this),this.#a=()=>{this.#e=no.none;let e=this.close();return this.#o(e.type,e.attrs,e.content)},this.closeNode=()=>{try{this.#a()}catch(e){console.error(e)}return this},this.#o=(e,t,n)=>{let r=e.createAndFill(t,n,this.#e);if(!r)throw oe(e,t,n);return this.push(r),r},this.addNode=(e,t,n)=>{try{this.#o(e,t,n)}catch(e){console.error(e)}return this},this.openMark=(e,t)=>{let n=e.create(t);return this.#e=n.addToSet(this.#e),this},this.closeMark=e=>(this.#e=e.removeFromSet(this.#e),this),this.addText=e=>{try{let t=this.top();if(!t)throw se();let n=t.pop(),r=this.schema.text(e,this.#e);if(!n)return t.push(r),this;let i=this.#n(n,r);return i?(t.push(i),this):(t.push(n,r),this)}catch(e){return console.error(e),this}},this.build=()=>{let e;do e=this.#a();while(this.size());return e},this.next=(e=[])=>([e].flat().forEach(e=>this.#i(e)),this),this.toDoc=()=>this.build(),this.run=(e,t)=>{let n=e.runSync(e.parse(t),t);return this.next(n),this},this.schema=e}#t;#n;#r;#i;#a;#o},Wu=class e extends Bu{constructor(e,t,n,r={}){super(),this.type=e,this.children=t,this.value=n,this.props=r,this.push=(e,...t)=>{this.children||=[],this.children.push(e,...t)},this.pop=()=>this.children?.pop()}static{this.create=(t,n,r,i={})=>new e(t,n,r,i)}},Gu=e=>Object.prototype.hasOwnProperty.call(e,`size`),Ku=class extends Vu{#e;static{this.create=(e,t)=>{let n=new this(e);return e=>(n.run(e),n.toString(t))}}constructor(e){super(),this.#e=no.none,this.#t=e=>{let t=Object.values({...this.schema.nodes,...this.schema.marks}).find(t=>t.spec.toMarkdown.match(e));if(!t)throw ce(e.type);return t},this.#n=e=>this.#t(e).spec.toMarkdown.runner(this,e),this.#r=(e,t)=>this.#t(e).spec.toMarkdown.runner(this,e,t),this.#i=e=>{let{marks:t}=e,n=e=>e.type.spec.priority??50;[...t].sort((e,t)=>n(e)-n(t)).every(t=>!this.#r(t,e))&&this.#n(e),t.forEach(e=>this.#f(e))},this.#a=(e,t)=>{if(e.type===t||e.children?.length!==1)return e;let n=e=>{if(e.type===t)return e.value==null?e:null;if(e.children?.length!==1)return null;let[r]=e.children;return r?n(r):null},r=n(e);if(!r)return e;let i=r.children?[...r.children]:void 0,a={...e,children:i};return a.children=i,r.children=[a],r},this.#o=e=>{let{children:t}=e;return t&&(e.children=t.reduce((e,t,n)=>{if(n===0)return[t];let r=e.at(-1);if(r&&r.isMark&&t.isMark){t=this.#a(t,r.type);let{children:n,...i}=t,{children:a,...o}=r;if(t.type===r.type&&n&&a&&JSON.stringify(i)===JSON.stringify(o)){let t={...o,children:[...a,...n]};return e.slice(0,-1).concat(this.#o(t))}}return e.concat(t)},[])),e},this.#s=e=>{let t={...e.props,type:e.type};return e.children&&(t.children=e.children),e.value&&(t.value=e.value),t},this.openNode=(e,t,n)=>(this.open(Wu.create(e,void 0,t,n)),this),this.#c=(e,t)=>{let n=``,r=``,i=e.children,a=-1,o=-1,s=e=>{e&&e.forEach((e,t)=>{e.type===`text`&&e.value&&(a<0&&(a=t),o=t)})};if(i){s(i);let e=i?.[o],t=i?.[a];if(e&&e.value.endsWith(` `)){let t=e.value,n=t.trimEnd();r=t.slice(n.length),e.value=n}if(t&&t.value.startsWith(` `)){let e=t.value,r=e.trimStart();n=e.slice(0,e.length-r.length),t.value=r}}n.length&&this.#u(`text`,void 0,n);let c=t();return r.length&&this.#u(`text`,void 0,r),c},this.#l=(e=!1)=>{let t=this.close(),n=()=>this.#u(t.type,t.children,t.value,t.props);return e?this.#c(t,n):n()},this.closeNode=()=>(this.#l(),this),this.#u=(e,t,n,r)=>{let i=Wu.create(e,t,n,r),a=this.#o(this.#s(i));return this.push(a),a},this.addNode=(e,t,n,r)=>(this.#u(e,t,n,r),this),this.#d=(e,t,n,r)=>e.isInSet(this.#e)?this:(this.#e=e.addToSet(this.#e),this.openNode(t,n,{...r,isMark:!0})),this.#f=e=>{e.isInSet(this.#e)&&(this.#e=e.type.removeFromSet(this.#e),this.#l(!0))},this.withMark=(e,t,n,r)=>(this.#d(e,t,n,r),this),this.closeMark=e=>(this.#f(e),this),this.build=()=>{let e=null;do e=this.#l();while(this.size());return e},this.next=e=>Gu(e)?(e.forEach(e=>{this.#i(e)}),this):(this.#i(e),this),this.toString=e=>e.stringify(this.build()),this.run=e=>(this.next(e),this),this.schema=e}#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f},qu=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Ju=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},Yu=null,Xu=function(e,t,n){let r=Yu||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},Zu=function(){Yu=null},Qu=function(e,t,n,r){return n&&(ed(e,t,n,r,-1)||ed(e,t,n,r,1))},$u=/^(img|br|input|textarea|hr)$/i;function ed(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:td(e))){let n=e.parentNode;if(!n||n.nodeType!=1||ad(e)||$u.test(e.nodeName)||e.contentEditable==`false`)return!1;t=qu(e)+(i<0?0:1),e=n}else if(e.nodeType==1){let n=e.childNodes[t+(i<0?-1:0)];if(n.nodeType==1&&n.contentEditable==`false`)if(n.pmViewDesc?.ignoreForSelection)t+=i;else return!1;else e=n,t=i<0?td(e):0}else return!1}}function td(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function nd(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable==`false`)return null;e=e.childNodes[t-1],t=td(e)}else if(e.parentNode&&!ad(e))t=qu(e),e=e.parentNode;else return null}}function rd(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable==`false`)return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!ad(e))t=qu(e)+1,e=e.parentNode;else return null}}function id(e,t,n){for(let r=t==0,i=t==td(e);r||i;){if(e==n)return!0;let t=qu(e);if(e=e.parentNode,!e)return!1;r&&=t==0,i&&=t==td(e)}}function ad(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var od=function(e){return e.focusNode&&Qu(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function sd(e,t){let n=document.createEvent(`Event`);return n.initEvent(`keydown`,!0,!0),n.keyCode=e,n.key=n.code=t,n}function cd(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function ld(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(td(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(td(r.startContainer),r.startOffset)}}}var ud=typeof navigator<`u`?navigator:null,dd=typeof document<`u`?document:null,fd=ud&&ud.userAgent||``,pd=/Edge\/(\d+)/.exec(fd),md=/MSIE \d/.exec(fd),hd=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(fd),gd=!!(md||hd||pd),_d=md?document.documentMode:hd?+hd[1]:pd?+pd[1]:0,vd=!gd&&/gecko\/(\d+)/i.test(fd);vd&&+(/Firefox\/(\d+)/.exec(fd)||[0,0])[1];var yd=!gd&&/Chrome\/(\d+)/.exec(fd),bd=!!yd,xd=yd?+yd[1]:0,Sd=!gd&&!!ud&&/Apple Computer/.test(ud.vendor),Cd=Sd&&(/Mobile\/\w+/.test(fd)||!!ud&&ud.maxTouchPoints>2),wd=Cd||(ud?/Mac/.test(ud.platform):!1),Td=ud?/Win/.test(ud.platform):!1,Ed=/Android \d/.test(fd),Dd=!!dd&&`webkitFontSmoothing`in dd.documentElement.style,Od=Dd?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function kd(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Ad(e,t){return typeof e==`number`?e:e[t]}function jd(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function Md(e,t,n){let r=e.someProp(`scrollThreshold`)||0,i=e.someProp(`scrollMargin`)||5,a=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(o.nodeType!=1){o=Ju(o);continue}let e=o,n=e==a.body,s=n?kd(a):jd(e),c=0,l=0;if(t.top<s.top+Ad(r,`top`)?l=-(s.top-t.top+Ad(i,`top`)):t.bottom>s.bottom-Ad(r,`bottom`)&&(l=t.bottom-t.top>s.bottom-s.top?t.top+Ad(i,`top`)-s.top:t.bottom-s.bottom+Ad(i,`bottom`)),t.left<s.left+Ad(r,`left`)?c=-(s.left-t.left+Ad(i,`left`)):t.right>s.right-Ad(r,`right`)&&(c=t.right-s.right+Ad(i,`right`)),c||l)if(n)a.defaultView.scrollBy(c,l);else{let n=e.scrollLeft,r=e.scrollTop;l&&(e.scrollTop+=l),c&&(e.scrollLeft+=c);let i=e.scrollLeft-n,a=e.scrollTop-r;t={left:t.left-i,top:t.top-a,right:t.right-i,bottom:t.bottom-a}}let u=n?`fixed`:getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(u))break;o=u==`absolute`?o.offsetParent:Ju(o)}}function Nd(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let a=(t.left+t.right)/2,o=n+1;o<Math.min(innerHeight,t.bottom);o+=5){let t=e.root.elementFromPoint(a,o);if(!t||t==e.dom||!e.dom.contains(t))continue;let s=t.getBoundingClientRect();if(s.top>=n-20){r=t,i=s.top;break}}return{refDOM:r,refTop:i,stack:Pd(e.dom)}}function Pd(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Ju(r));return t}function Fd({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;Id(n,r==0?0:r-t)}function Id(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:a}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=a&&(r.scrollLeft=a)}}var Ld=null;function Rd(e){if(e.setActive)return e.setActive();if(Ld)return e.focus(Ld);let t=Pd(e);e.focus(Ld==null?{get preventScroll(){return Ld={preventScroll:!0},!0}}:void 0),Ld||(Ld=!1,Id(t,0))}function zd(e,t){let n,r=2e8,i,a=0,o=t.top,s=t.top,c,l;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let e;if(u.nodeType==1)e=u.getClientRects();else if(u.nodeType==3)e=Xu(u).getClientRects();else continue;for(let f=0;f<e.length;f++){let p=e[f];if(p.top<=o&&p.bottom>=s){o=Math.max(p.bottom,o),s=Math.min(p.top,s);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<r){n=u,r=e,i=e&&n.nodeType==3?{left:p.right<t.left?p.right:p.left,top:t.top}:t,u.nodeType==1&&e&&(a=d+ +(t.left>=(p.left+p.right)/2));continue}}else p.top>t.top&&!c&&p.left<=t.left&&p.right>=t.left&&(c=u,l={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=d+1)}}return!n&&c&&(n=c,i=l,r=0),n&&n.nodeType==3?Bd(n,i):!n||r&&n.nodeType==1?{node:e,offset:a}:zd(n,i)}function Bd(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let a=0;a<n;a++){r.setEnd(e,a+1),r.setStart(e,a);let n=Jd(r,1);if(n.top!=n.bottom&&Vd(t,n)){i={node:e,offset:a+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}function Vd(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function Hd(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function Ud(e,t,n){let{node:r,offset:i}=zd(t,n),a=-1;if(r.nodeType==1&&!r.firstChild){let e=r.getBoundingClientRect();a=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,a)}function Wd(e,t,n,r){let i=-1;for(let n=t,a=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),o;if(!t)return null;if(t.dom.nodeType==1&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((o=t.dom.getBoundingClientRect()).width||o.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!a&&o.left>r.left||o.top>r.top?i=t.posBefore:(!a&&o.right<r.left||o.bottom<r.top)&&(i=t.posAfter),a=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(o.top+o.bottom)/2:r.left<(o.left+o.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function Gd(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),a=i;;){let n=e.childNodes[a];if(n.nodeType==1){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(Vd(t,i))return Gd(n,t,i)}}if((a=(a+1)%r)==i)break}return e}function Kd(e,t){let n=e.dom.ownerDocument,r,i=0,a=ld(n,t.left,t.top);a&&({node:r,offset:i}=a);let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),s;if(!o||!e.dom.contains(o.nodeType==1?o:o.parentNode)){let n=e.dom.getBoundingClientRect();if(!Vd(t,n)||(o=Gd(e.dom,t,n),!o))return null}if(Sd)for(let e=o;r&&e;e=Ju(e))e.draggable&&(r=void 0);if(o=Hd(o,t),r){if(vd&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let e=r.childNodes[i],n;e.nodeName==`IMG`&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&i++}let n;Dd&&i&&r.nodeType==1&&(n=r.childNodes[i-1]).nodeType==1&&n.contentEditable==`false`&&n.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!=`BR`)&&(s=Wd(e,r,i,t))}s??=Ud(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function qd(e){return e.top<e.bottom||e.left<e.right}function Jd(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(qd(e))return e}return Array.prototype.find.call(n,qd)||e.getBoundingClientRect()}var Yd=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Xd(e,t,n){let{node:r,offset:i,atom:a}=e.docView.domFromPos(t,n<0?-1:1),o=Dd||vd;if(r.nodeType==3)if(o&&(Yd.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=Jd(Xu(r,i,i),n);if(vd&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=Jd(Xu(r,i-1,i-1),-1);if(t.top==e.top){let n=Jd(Xu(r,i,i+1),-1);if(n.top!=e.top)return Zd(n,n.left<t.left)}}return e}else{let e=i,t=i,a=n<0?1:-1;return n<0&&!i?(t++,a=-1):n>=0&&i==r.nodeValue.length?(e--,a=1):n<0?e--:t++,Zd(Jd(Xu(r,e,t),a),a<0)}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==td(r))){let e=r.childNodes[i-1];if(e.nodeType==1)return Qd(e.getBoundingClientRect(),!1)}if(a==null&&i<td(r)){let e=r.childNodes[i];if(e.nodeType==1)return Qd(e.getBoundingClientRect(),!0)}return Qd(r.getBoundingClientRect(),n>=0)}if(a==null&&i&&(n<0||i==td(r))){let e=r.childNodes[i-1],t=e.nodeType==3?Xu(e,td(e)-+!o):e.nodeType==1&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return Zd(Jd(t,1),!1)}if(a==null&&i<td(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?e.nodeType==3?Xu(e,0,+!o):e.nodeType==1?e:null:null;if(t)return Zd(Jd(t,-1),!0)}return Zd(Jd(r.nodeType==3?Xu(r):r,-n),n>=0)}function Zd(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function Qd(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function $d(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function ef(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return $d(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,n==`up`?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=Xd(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(e.nodeType==1)t=e.getClientRects();else if(e.nodeType==3)t=Xu(e,0,e.nodeValue.length).getClientRects();else continue;for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&(n==`up`?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})}var tf=/[\u0590-\u08ac]/;function nf(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,a=!i,o=i==r.parent.content.size,s=e.domSelection();return s?!tf.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:$d(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:a,anchorOffset:o}=e.domSelectionRange(),c=s.caretBidiLevel;s.modify(`move`,n,`character`);let l=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),f=u&&!l.contains(u.nodeType==1?u:u.parentNode)||t==u&&i==d;try{s.collapse(a,o),t&&(t!=a||i!=o)&&s.extend&&s.extend(t,i)}catch{}return c!=null&&(s.caretBidiLevel=c),f}):r.pos==r.start()||r.pos==r.end()}var rf=null,af=null,of=!1;function sf(e,t,n){return rf==t&&af==n?of:(rf=t,af=n,of=n==`up`||n==`down`?ef(e,t,n):nf(e,t,n))}var cf=0,lf=1,uf=2,df=3,ff=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=cf,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}else{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}let r;if(e==this.dom&&this.contentDOM)r=t>qu(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(r==null&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return r??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),a;if(i&&(!t||i.node))if(n&&(a=i.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))n=!1;else return i}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],a=t+i.size;if(a>e||i instanceof yf){r=e-t;break}t=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof pf&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,!(!e||e.dom.parentNode==this.contentDOM);n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?qu(e.dom)+1:0}}else{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,!(!e||e.dom.parentNode==this.contentDOM);n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?qu(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let a=n,o=0;;o++){let n=this.children[o],s=a+n.size;if(r==-1&&e<=s){let i=a+n.border;if(e>=i&&t<=s-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=a;for(let t=o;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=qu(n.dom)+1;break}e-=n.size}r==-1&&(r=0)}if(r>-1&&(s>t||o==this.children.length-1)){t=s;for(let e=o+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=qu(n.dom);break}t+=n.size}i==-1&&(i=this.contentDOM.childNodes.length);break}a=s}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(t.nodeType!=1||n==t.childNodes.length)throw RangeError(`No node after pos `+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),a=Math.max(e,t);for(let o=0,s=0;o<this.children.length;o++){let c=this.children[o],l=s+c.size;if(i>s&&a<l)return c.setSelection(e-s-c.border,t-s-c.border,n,r);s=l}let o=this.domFromPos(e,e?-1:1),s=t==e?o:this.domFromPos(t,t?-1:1),c=n.root.getSelection(),l=n.domSelectionRange(),u=!1;if((vd||Sd)&&e==t){let{node:e,offset:t}=o;if(e.nodeType==3){if(u=!!(t&&e.nodeValue[t-1]==`
|
|
41
|
+
`),u&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){n.nodeName==`BR`&&(o=s={node:n.parentNode,offset:qu(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&(n.nodeName==`BR`||n.contentEditable==`false`)}}if(vd&&l.focusNode&&l.focusNode!=s.node&&l.focusNode.nodeType==1){let e=l.focusNode.childNodes[l.focusOffset];e&&e.contentEditable==`false`&&(r=!0)}if(!(r||u&&Sd)&&Qu(o.node,o.offset,l.anchorNode,l.anchorOffset)&&Qu(s.node,s.offset,l.focusNode,l.focusOffset))return;let d=!1;if((c.extend||e==t)&&!(u&&vd)){c.collapse(o.node,o.offset);try{e!=t&&c.extend(s.node,s.offset),d=!0}catch{}}if(!d){if(e>t){let e=o;o=s,s=e}let n=document.createRange();n.setEnd(s.node,s.offset),n.setStart(o.node,o.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&e.type!=`selection`}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],a=n+i.size;if(n==a?e<=a&&t>=n:e<a&&t>n){let r=n+i.border,o=a-i.border;if(e>=r&&t<=o){this.dirty=e==n||t==a?uf:lf,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=df:i.markDirty(e-r,t-r);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?uf:df}n=a}this.dirty=uf}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?uf:lf;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},pf=class extends ff{constructor(e,t,n,r){let i,a=t.type.toDOM;if(typeof a==`function`&&(a=a(n,()=>{if(!i)return r;if(i.parent)return i.parent.posBeforeChild(i)})),!t.type.spec.raw){if(a.nodeType!=1){let e=document.createElement(`span`);e.appendChild(a),a=e}a.contentEditable=`false`,a.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==cf&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!=`selection`||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},mf=class extends ff{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e==this.textDOM?this.posAtStart+t:this.posAtStart+(t?this.size:0)}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type===`characterData`&&e.target.nodeValue==e.oldValue}},hf=class e extends ff{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(t,n,r,i){let a=i.nodeViews[n.type.name],o=a&&a(n,i,r);return(!o||!o.dom)&&(o=ps.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&df||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=df&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=cf){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=cf}}slice(t,n,r){let i=e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=If(a,n,o,r)),t>0&&(a=If(a,0,t,r));for(let e=0;e<a.length;e++)a[e].parent=i;return i.children=a,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},gf=class e extends ff{constructor(e,t,n,r,i,a,o,s,c){super(e,[],i,a),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o}static create(t,n,r,i,a,o){let s=a.nodeViews[n.type.name],c,l=s&&s(n,a,()=>{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=l&&l.dom,d=l&&l.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=ps.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);({dom:u,contentDOM:d}=e)}!d&&!n.isText&&u.nodeName!=`BR`&&(u.hasAttribute(`contenteditable`)||(u.contentEditable=`false`),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=Df(u,r,n),l?c=new bf(t,n,r,i,u,d||null,f,l,a,o+1):n.isText?new vf(t,n,r,i,u,f,a):new e(t,n,r,i,u,d||null,f,a,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace==`pre`&&(e.preserveWhitespace=`full`),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>A.empty)}return e}matchesNode(e,t,n){return this.dirty==cf&&e.eq(this.node)&&Of(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,o=i&&i.pos<0,s=new Af(this,a&&a.node,e);Nf(this.node,this.innerDeco,(t,i,a)=>{t.spec.marks?s.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!a&&s.syncToMarks(i==this.node.childCount?no.none:this.node.child(i).marks,n,e,i),s.placeWidget(t,e,r)},(t,a,c,l)=>{s.syncToMarks(t.marks,n,e,l);let u;s.findNodeMatch(t,a,c,l)||o&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(t,a,c,u,e)||s.updateNextNode(t,a,c,e,l,r)||s.addNode(t,a,c,e,r),r+=t.nodeSize}),s.syncToMarks([],n,e,0),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==uf)&&(a&&this.protectLocalComposition(e,a),xf(this.contentDOM,this.children,e),Cd&&Pf(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof M)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let e=i.nodeValue,a=Ff(this.node.content,e,n-t,r-t);return a<0?null:{node:i,pos:a,text:e}}else return{node:i,pos:-1,text:``}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&=void 0}let a=new mf(this,i,t,r);e.input.compositionNodes.push(a),this.children=If(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==df||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=cf}updateOuterDeco(e){if(Of(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=Tf(this.dom,this.nodeDOM,wf(this.outerDeco,this.node,t),wf(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute(`draggable`))}get domAtom(){return this.node.isAtom}};function _f(e,t,n,r,i){Df(r,t,e);let a=new gf(void 0,e,t,n,r,r,r,i,0);return a.contentDOM&&a.updateChildren(i,0),a}var vf=class e extends gf{constructor(e,t,n,r,i,a,o){super(e,t,n,r,i,null,a,o,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return this.dirty==df||this.dirty!=cf&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=cf||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=cf,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!=`characterData`&&e.type!=`selection`}slice(t,n,r){let i=this.node.cut(t,n),a=document.createTextNode(i.text);return new e(this.parent,i,this.outerDeco,this.innerDeco,a,a,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=df)}get domAtom(){return!1}isText(e){return this.node.text==e}},yf=class extends ff{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==cf&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==`IMG`}},bf=class extends gf{constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,c,l),this.spec=s}update(e,t,n,r){if(this.dirty==df)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}else if(!this.contentDOM&&!e.isLeaf)return!1;else return super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function xf(e,t,n){let r=e.firstChild,i=!1;for(let a=0;a<t.length;a++){let o=t[a],s=o.dom;if(s.parentNode==e){for(;s!=r;)r=kf(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(s,r);if(o instanceof hf){let t=r?r.previousSibling:e.lastChild;xf(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=kf(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}var Sf=function(e){e&&(this.nodeName=e)};Sf.prototype=Object.create(null);var Cf=[new Sf];function wf(e,t,n){if(e.length==0)return Cf;let r=n?Cf[0]:new Sf,i=[r];for(let a=0;a<e.length;a++){let o=e[a].type.attrs;if(o){o.nodeName&&i.push(r=new Sf(o.nodeName));for(let e in o){let a=o[e];a!=null&&(n&&i.length==1&&i.push(r=new Sf(t.isInline?`span`:`div`)),e==`class`?r.class=(r.class?r.class+` `:``)+a:e==`style`?r.style=(r.style?r.style+`;`:``)+a:e!=`nodeName`&&(r[e]=a))}}}return i}function Tf(e,t,n,r){if(n==Cf&&r==Cf)return t;let i=t;for(let t=0;t<r.length;t++){let a=r[t],o=n[t];if(t){let t;o&&o.nodeName==a.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==a.nodeName?i=t:(t=document.createElement(a.nodeName),t.pmIsDeco=!0,t.appendChild(i),o=Cf[0],i=t)}Ef(i,o||Cf[0],a)}return i}function Ef(e,t,n){for(let r in t)r!=`class`&&r!=`style`&&r!=`nodeName`&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!=`class`&&r!=`style`&&r!=`nodeName`&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(` `).filter(Boolean):[],i=n.class?n.class.split(` `).filter(Boolean):[];for(let t=0;t<r.length;t++)i.indexOf(r[t])==-1&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)r.indexOf(i[t])==-1&&e.classList.add(i[t]);e.classList.length==0&&e.removeAttribute(`class`)}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}function Df(e,t,n){return Tf(e,e,Cf,wf(t,n,e.nodeType!=1))}function Of(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function kf(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var Af=class{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=jf(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let i=0,a=this.stack.length>>1,o=Math.min(a,e.length);for(;i<o&&(i==a-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<a;)this.destroyRest(),this.top.dirty=cf,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<e.length;){this.stack.push(this.top,this.index+1);let i=-1,o=this.top.children.length;r<this.preMatch.index&&(o=Math.min(this.index+3,o));for(let t=this.index;t<o;t++){let n=this.top.children[t];if(n.matchesMark(e[a])&&!this.isLocked(n.dom)){i=t;break}}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=hf.create(this.top,e[a],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,a++}}findNodeMatch(e,t,n,r){let i=-1,a;if(r>=this.preMatch.index&&(a=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&a.matchesNode(e,t,n))i=this.top.children.indexOf(a,this.index);else for(let r=this.index,a=Math.min(this.top.children.length,r+5);r<a;r++){let a=this.top.children[r];if(a.matchesNode(e,t,n)&&!this.preMatch.matched.has(a)){i=r;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,i){let a=this.top.children[r];return a.dirty==df&&a.dom==a.contentDOM&&(a.dirty=uf),a.update(e,t,n,i)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return-1}e=t}}updateNextNode(e,t,n,r,i,a){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof gf){let c=this.preMatch.matched.get(s);if(c!=null&&c!=i)return!1;let l=s.dom,u,d=this.isLocked(l)&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=df&&Of(t,s.outerDeco));if(!d&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;if(!d&&(u=this.recreateWrapper(s,e,t,n,r,a)))return this.destroyBetween(this.index,o),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=uf,u.updateChildren(r,a+1),u.dirty=cf),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,a){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!Of(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=gf.create(this.top,t,n,r,i,a);if(o.contentDOM){o.children=e.children,e.children=[];for(let e of o.children)e.parent=o}return e.destroy(),o}addNode(e,t,n,r,i){let a=gf.create(this.top,e,t,n,r,i);a.contentDOM&&a.updateChildren(r,i+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new pf(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof hf;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof vf)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Sd||bd)&&e&&e.dom.contentEditable==`false`&&this.addHackNode(`IMG`,t),this.addHackNode(`BR`,this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e==`IMG`&&(n.className=`ProseMirror-separator`,n.alt=``),e==`BR`&&(n.className=`ProseMirror-trailingBreak`);let r=new yf(this.top,[],n,null);t==this.top?t.children.splice(this.index++,0,r):t.children.push(r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}};function jf(e,t){let n=t,r=n.children.length,i=e.childCount,a=new Map,o=[];outer:for(;i>0;){let s;for(;;)if(r){let e=n.children[r-1];if(e instanceof hf)n=e,r=e.children.length;else{s=e,r--;break}}else if(n==t)break outer;else r=n.parent.children.indexOf(n),n=n.parent;let c=s.node;if(c){if(c!=e.child(i-1))break;--i,a.set(s,i),o.push(s)}}return{index:i,matched:a,matches:o.reverse()}}function Mf(e,t){return e.type.side-t.type.side}function Nf(e,t,n,r){let i=t.locals(e),a=0;if(i.length==0){for(let n=0;n<e.childCount;n++){let o=e.child(n);r(o,i,t.forChild(a,o),n),a+=o.nodeSize}return}let o=0,s=[],c=null;for(let l=0;;){let u,d;for(;o<i.length&&i[o].to==a;){let e=i[o++];e.widget&&(u?(d||=[u]).push(e):u=e)}if(u)if(d){d.sort(Mf);for(let e=0;e<d.length;e++)n(d[e],l,!!c)}else n(u,l,!!c);let f,p;if(c)p=-1,f=c,c=null;else if(l<e.childCount)p=l,f=e.child(l++);else break;for(let e=0;e<s.length;e++)s[e].to<=a&&s.splice(e--,1);for(;o<i.length&&i[o].from<=a&&i[o].to>a;)s.push(i[o++]);let m=a+f.nodeSize;if(f.isText){let e=m;o<i.length&&i[o].from<e&&(e=i[o].from);for(let t=0;t<s.length;t++)s[t].to<e&&(e=s[t].to);e<m&&(c=f.cut(e-a),f=f.cut(0,e-a),m=e,p=-1)}else for(;o<i.length&&i[o].to<m;)o++;let h=f.isInline&&!f.isLeaf?s.filter(e=>!e.inline):s.slice();r(f,h,t.forChild(a,f),p),a=m}}function Pf(e){if(e.nodeName==`UL`||e.nodeName==`OL`){let t=e.style.cssText;e.style.cssText=t+`; list-style: square !important`,window.getComputedStyle(e).listStyle,e.style.cssText=t}}function Ff(e,t,n,r){for(let i=0,a=0;i<e.childCount&&a<=r;){let o=e.child(i++),s=a;if(a+=o.nodeSize,!o.isText)continue;let c=o.text;for(;i<e.childCount;){let t=e.child(i++);if(a+=t.nodeSize,!t.isText)break;c+=t.text}if(a>=n){if(a>=r&&c.slice(r-t.length-s,r-s)==t)return r-t.length;let e=s<r?c.lastIndexOf(t,r-s-1):-1;if(e>=0&&e+t.length+s>=n)return s+e;if(n==r&&c.length>=r+t.length-s&&c.slice(r-s,r-s+t.length)==t)return r}}return-1}function If(e,t,n,r,i){let a=[];for(let o=0,s=0;o<e.length;o++){let c=e[o],l=s,u=s+=c.size;l>=n||u<=t?a.push(c):(l<t&&a.push(c.slice(0,t-l,r)),i&&=(a.push(i),void 0),u>n&&a.push(c.slice(n-l,c.size,r)))}return a}function Lf(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),a=i&&i.size==0,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let s=r.resolve(o),c,l;if(od(n)){for(c=o;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&N.isSelectable(e)&&i.parent&&!(e.isInline&&id(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new N(o==e?s:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=o,i=o;for(let r=0;r<n.rangeCount;r++){let a=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(a.startContainer,a.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(a.endContainer,a.endOffset,-1))}if(t<0)return null;[c,o]=i==e.state.selection.anchor?[i,t]:[t,i],s=r.resolve(o)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!l){let n=t==`pointer`||e.state.selection.head<s.pos&&!a?1:-1;l=Jf(e,u,s,n)}return l}function Rf(e){return e.editable?e.hasFocus():Xf(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function zf(e,t=!1){let n=e.state.selection;if(Kf(e,n),Rf(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&bd){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&Qu(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)Gf(e);else{let{anchor:r,head:i}=n,a,o;Bf&&!(n instanceof M)&&(n.$from.parent.inlineContent||(a=Vf(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=Vf(e,n.to))),e.docView.setSelection(r,i,e,t),Bf&&(a&&Uf(a),o&&Uf(o)),n.visible?e.dom.classList.remove(`ProseMirror-hideselection`):(e.dom.classList.add(`ProseMirror-hideselection`),`onselectionchange`in document&&Wf(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}var Bf=Sd||bd&&xd<63;function Vf(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,a=r?n.childNodes[r-1]:null;if(Sd&&i&&i.contentEditable==`false`)return Hf(i);if((!i||i.contentEditable==`false`)&&(!a||a.contentEditable==`false`)){if(i)return Hf(i);if(a)return Hf(a)}}function Hf(e){return e.contentEditable=`true`,Sd&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Uf(e){e.contentEditable=`false`,e.wasDraggable&&=(e.draggable=!0,null)}function Wf(e){let t=e.dom.ownerDocument;t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener(`selectionchange`,e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard),setTimeout(()=>{(!Rf(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function Gf(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName==`IMG`;r?t.collapse(n.parentNode,qu(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&gd&&_d<=11&&(n.disabled=!0,n.disabled=!1)}function Kf(e,t){if(t instanceof N){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(qf(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else qf(e)}function qf(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function Jf(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||M.between(t,n,r)}function Yf(e){return e.editable&&!e.hasFocus()?!1:Xf(e)}function Xf(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function Zf(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return Qu(t.node,t.offset,n.anchorNode,n.anchorOffset)}function Qf(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&Nc.findFrom(a,t)}function $f(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function ep(e,t,n){let r=e.state.selection;if(r instanceof M){if(n.indexOf(`s`)>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let a=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return $f(e,new M(r.$anchor,a))}else if(!r.empty)return!1;else if(e.endOfTextblock(t>0?`forward`:`backward`)){let n=Qf(e.state,t);return n&&n instanceof N?$f(e,n):!1}else if(!(wd&&n.indexOf(`m`)>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,a;if(!i||i.isText)return!1;let o=t<0?n.pos-i.nodeSize:n.pos;return i.isAtom||(a=e.docView.descAt(o))&&!a.contentDOM?N.isSelectable(i)?$f(e,new N(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):Dd?$f(e,new M(e.state.doc.resolve(t<0?o:o+i.nodeSize))):!1:!1}}else if(r instanceof N&&r.node.isInline)return $f(e,new M(t>0?r.$to:r.$from));else{let n=Qf(e.state,t);return n?$f(e,n):!1}}function tp(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function np(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`)}function rp(e,t){return t<0?ip(e):ap(e)}function ip(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for(vd&&n.nodeType==1&&r<tp(n)&&np(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let e=n.childNodes[r-1];if(np(e,-1))i=n,a=--r;else if(e.nodeType==3)n=e,r=n.nodeValue.length;else break}}else if(op(n))break;else{let t=n.previousSibling;for(;t&&np(t,-1);)i=n.parentNode,a=qu(t),t=t.previousSibling;if(t)n=t,r=tp(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?lp(e,n,r):i&&lp(e,i,a)}function ap(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=tp(n),a,o;for(;;)if(r<i){if(n.nodeType!=1)break;let e=n.childNodes[r];if(np(e,1))a=n,o=++r;else break}else if(op(n))break;else{let t=n.nextSibling;for(;t&&np(t,1);)a=t.parentNode,o=qu(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=tp(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}a&&lp(e,a,o)}function op(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function sp(e,t){for(;e&&t==e.childNodes.length&&!ad(e);)t=qu(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=0}}function cp(e,t){for(;e&&!t&&!ad(e);)t=qu(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=e.childNodes.length}}function lp(e,t,n){if(t.nodeType!=3){let e,r;(r=sp(t,n))?(t=r,n=0):(e=cp(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(od(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&zf(e)},50)}function up(e,t){let n=e.state.doc.resolve(t);if(!(bd||Td)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?`ltr`:`rtl`}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?`ltr`:`rtl`}}return getComputedStyle(e.dom).direction==`rtl`?`rtl`:`ltr`}function dp(e,t,n){let r=e.state.selection;if(r instanceof M&&!r.empty||n.indexOf(`s`)>-1||wd&&n.indexOf(`m`)>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?`up`:`down`)){let n=Qf(e.state,t);if(n&&n instanceof N)return $f(e,n)}if(!i.parent.inlineContent){let n=t<0?i:a,o=r instanceof zc?Nc.near(n,t):Nc.findFrom(n,t);return o?$f(e,o):!1}return!1}function fp(e,t){if(!(e.state.selection instanceof M))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`))return!0;let a=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){let r=e.state.tr;return t<0?r.delete(n.pos-a.nodeSize,n.pos):r.delete(n.pos,n.pos+a.nodeSize),e.dispatch(r),!0}return!1}function pp(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function mp(e){if(!Sd||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable==`false`){let n=t.firstChild;pp(e,n,`true`),setTimeout(()=>pp(e,n,`false`),20)}return!1}function hp(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function gp(e,t){let n=t.keyCode,r=hp(t);if(n==8||wd&&n==72&&r==`c`)return fp(e,-1)||rp(e,-1);if(n==46&&!t.shiftKey||wd&&n==68&&r==`c`)return fp(e,1)||rp(e,1);if(n==13||n==27)return!0;if(n==37||wd&&n==66&&r==`c`){let t=n==37?up(e,e.state.selection.from)==`ltr`?-1:1:-1;return ep(e,t,r)||rp(e,t)}else if(n==39||wd&&n==70&&r==`c`){let t=n==39?up(e,e.state.selection.from)==`ltr`?1:-1:1;return ep(e,t,r)||rp(e,t)}else if(n==38||wd&&n==80&&r==`c`)return dp(e,-1,r)||rp(e,-1);else if(n==40||wd&&n==78&&r==`c`)return mp(e)||dp(e,1,r)||rp(e,1);else if(r==(wd?`m`:`c`)&&(n==66||n==73||n==89||n==90))return!0;return!1}function _p(e,t){e.someProp(`transformCopied`,n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:a}=t;for(;i>1&&a>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,a--;let e=r.firstChild;n.push(e.type.name,e.attrs==e.type.defaultAttrs?null:e.attrs),r=e.content}let o=e.someProp(`clipboardSerializer`)||ps.fromSchema(e.state.schema),s=Op(),c=s.createElement(`div`);c.appendChild(o.serializeFragment(r,{document:s}));let l=c.firstChild,u,d=0;for(;l&&l.nodeType==1&&(u=Ep[l.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=s.createElement(u[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),d++}l=c.firstChild}return l&&l.nodeType==1&&l.setAttribute(`data-pm-slice`,`${i} ${a}${d?` -${d}`:``} ${JSON.stringify(n)}`),{dom:c,text:e.someProp(`clipboardTextSerializer`,n=>n(t,e))||t.content.textBetween(0,t.content.size,`
|
|
42
|
+
|
|
43
|
+
`),slice:t}}function vp(e,t,n,r,i){let a=i.parent.type.spec.code,o,s;if(!n&&!t)return null;let c=!!t&&(r||a||!n);if(c){if(e.someProp(`transformPastedText`,n=>{t=n(t,a||r,e)}),a)return s=new j(A.from(e.state.schema.text(t.replace(/\r\n?/g,`
|
|
44
|
+
`))),0,0),e.someProp(`transformPasted`,t=>{s=t(s,e,!0)}),s;let n=e.someProp(`clipboardTextParser`,n=>n(t,i,r,e));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,a=ps.fromSchema(r);o=document.createElement(`div`),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement(`p`));e&&t.appendChild(a.serializeNode(r.text(e,n)))})}}else e.someProp(`transformPastedHTML`,t=>{n=t(n,e)}),o=jp(n),Dd&&Mp(o);let l=o&&o.querySelector(`[data-pm-slice]`),u=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute(`data-pm-slice`)||``);if(u&&u[3])for(let e=+u[3];e>0;e--){let e=o.firstChild;for(;e&&e.nodeType!=1;)e=e.nextSibling;if(!e)break;o=e}if(s||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||Qo.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!yp.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=Np(Tp(s,+u[1],+u[2]),u[4]);else if(s=j.maxOpen(bp(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=Tp(s,e,t)}return e.someProp(`transformPasted`,t=>{s=t(s,e,c)}),s}var yp=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function bp(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,a=[];if(e.forEach(e=>{if(!a)return;let t=r.findWrapping(e.type),n;if(!t)return a=null;if(n=a.length&&i.length&&Sp(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=Cp(a[a.length-1],i.length));let n=xp(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return A.from(a)}return e}function xp(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,A.from(e));return e}function Sp(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let a=Sp(e,t,n,r.lastChild,i+1);if(a)return r.copy(r.content.replaceChild(r.childCount-1,a));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(A.from(xp(n,e,i+1))))}}function Cp(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,Cp(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(A.empty,!0);return e.copy(n.append(r))}function wp(e,t,n,r,i,a){let o=t<0?e.firstChild:e.lastChild,s=o.content;return e.childCount>1&&(a=0),i<r-1&&(s=wp(s,t,n,r,i+1,a)),i>=n&&(s=t<0?o.contentMatchAt(0).fillBefore(s,a<=i).append(s):s.append(o.contentMatchAt(o.childCount).fillBefore(A.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(s))}function Tp(e,t,n){return t<e.openStart&&(e=new j(wp(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new j(wp(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var Ep={thead:[`table`],tbody:[`table`],tfoot:[`table`],caption:[`table`],colgroup:[`table`],col:[`table`,`colgroup`],tr:[`table`,`tbody`],td:[`table`,`tbody`,`tr`],th:[`table`,`tbody`,`tr`]},Dp=null;function Op(){return Dp||=document.implementation.createHTMLDocument(`title`)}var kp=null;function Ap(e){let t=window.trustedTypes;return t?(kp||=t.defaultPolicy||t.createPolicy(`ProseMirrorClipboard`,{createHTML:e=>e}),kp.createHTML(e)):e}function jp(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=Op().createElement(`div`),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&Ep[r[1].toLowerCase()])&&(e=i.map(e=>`<`+e+`>`).join(``)+e+i.map(e=>`</`+e+`>`).reverse().join(``)),n.innerHTML=Ap(e),i)for(let e=0;e<i.length;e++)n=n.querySelector(i[e])||n;return n}function Mp(e){let t=e.querySelectorAll(bd?`span:not([class]):not([style])`:`span.Apple-converted-space`);for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==`\xA0`&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(` `),r)}}function Np(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:a,openEnd:o}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;i=A.from(t.create(r[e+1],i)),a++,o++}return new j(i,a,o)}var Pp={},Fp={},Ip={touchstart:!0,touchmove:!0},Lp=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:``,button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function Rp(e){for(let t in Pp){let n=Pp[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{Up(e,t)&&!Hp(e,t)&&(e.editable||!(t.type in Fp))&&n(e,t)},Ip[t]?{passive:!0}:void 0)}Sd&&e.dom.addEventListener(`input`,()=>null),Vp(e)}function zp(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Bp(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function Vp(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Hp(e,t))})}function Hp(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function Up(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function Wp(e,t){!Hp(e,t)&&Pp[t.type]&&(e.editable||!(t.type in Fp))&&Pp[t.type](e,t)}Fp.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!im(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Ed&&bd&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),Cd&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp(`handleKeyDown`,t=>t(e,sd(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||gp(e,n)?n.preventDefault():zp(e,`key`)},Fp.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},Fp.keypress=(e,t)=>{let n=t;if(im(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||wd&&n.metaKey)return;if(e.someProp(`handleKeyPress`,t=>t(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof M)||!r.$from.sameParent(r.$to)){let t=String.fromCharCode(n.charCode),i=()=>e.state.tr.insertText(t).scrollIntoView();!/[\r\n]/.test(t)&&!e.someProp(`handleTextInput`,n=>n(e,r.$from.pos,r.$to.pos,t,i))&&e.dispatch(i()),n.preventDefault()}};function Gp(e){return{left:e.clientX,top:e.clientY}}function Kp(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function qp(e,t,n,r,i){if(r==-1)return!1;let a=e.state.doc.resolve(r);for(let r=a.depth+1;r>0;r--)if(e.someProp(t,t=>r>a.depth?t(e,n,a.nodeAfter,a.before(r),i,!0):t(e,n,a.node(r),a.before(r),i,!1)))return!0;return!1}function Jp(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);n==`pointer`&&r.setMeta(`pointer`,!0),e.dispatch(r)}function Yp(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&N.isSelectable(r)?(Jp(e,new N(n),`pointer`),!0):!1}function Xp(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof N&&(r=n.node);let a=e.state.doc.resolve(t);for(let e=a.depth+1;e>0;e--){let t=e>a.depth?a.nodeAfter:a.node(e);if(N.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?a.before(n.$from.depth):a.before(e);break}}return i==null?!1:(Jp(e,N.create(e.state.doc,i),`pointer`),!0)}function Zp(e,t,n,r,i){return qp(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?Xp(e,n):Yp(e,n))}function Qp(e,t,n,r){return qp(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function $p(e,t,n,r){return qp(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||em(e,n,r)}function em(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(Jp(e,M.create(r,0,r.content.size),`pointer`),!0):!1;let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),a=i.before(t);if(n.inlineContent)Jp(e,M.create(r,a+1,a+1+n.content.size),`pointer`);else if(N.isSelectable(n))Jp(e,N.create(r,a),`pointer`);else continue;return!0}}function tm(e){return dm(e)}var nm=wd?`metaKey`:`ctrlKey`;Pp.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=tm(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&Kp(n,e.input.lastClick)&&!n[nm]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type==`singleClick`?a=`doubleClick`:e.input.lastClick.type==`doubleClick`&&(a=`tripleClick`)),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:a,button:n.button};let o=e.posAtCoords(Gp(n));o&&(a==`singleClick`?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new rm(e,o,n,!!r)):(a==`doubleClick`?Qp:$p)(e,o.pos,o.inside,n)?n.preventDefault():zp(e,`pointer`))};var rm=class{constructor(e,t,n,r){this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[nm],this.allowDefault=n.shiftKey;let i,a;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),a=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,a=n.depth?n.before():0}let o=r?null:n.target,s=o?e.docView.nearestDesc(o,!0):null;this.target=s&&s.nodeDOM.nodeType==1?s.nodeDOM:null;let{selection:c}=e.state;n.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof N&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&vd&&!this.target.hasAttribute(`contentEditable`))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute(`contentEditable`,`false`)},20),this.view.domObserver.start()),e.root.addEventListener(`mouseup`,this.up=this.up.bind(this)),e.root.addEventListener(`mousemove`,this.move=this.move.bind(this)),zp(e,`pointer`)}done(){this.view.root.removeEventListener(`mouseup`,this.up),this.view.root.removeEventListener(`mousemove`,this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute(`draggable`),this.mightDrag.setUneditable&&this.target.removeAttribute(`contentEditable`),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>zf(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Gp(e))),this.updateAllowDefault(e),this.allowDefault||!t?zp(this.view,`pointer`):Zp(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Sd&&this.mightDrag&&!this.mightDrag.node.isAtom||bd&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Jp(this.view,Nc.near(this.view.state.doc.resolve(t.pos)),`pointer`),e.preventDefault()):zp(this.view,`pointer`)}move(e){this.updateAllowDefault(e),zp(this.view,`pointer`),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}};Pp.touchstart=e=>{e.input.lastTouch=Date.now(),tm(e),zp(e,`pointer`)},Pp.touchmove=e=>{e.input.lastTouch=Date.now(),zp(e,`pointer`)},Pp.contextmenu=e=>tm(e);function im(e,t){return e.composing?!0:Sd&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var am=Ed?5e3:-1;Fp.compositionstart=Fp.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof M&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)||bd&&Td&&om(e)))e.markCursor=e.state.storedMarks||n.marks(),dm(e,!0),e.markCursor=null;else if(dm(e,!t.selection.empty),vd&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&n.nodeType==1&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(t.nodeType==3){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}else n=t,r=-1}}e.input.composing=!0}sm(e,am)};function om(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return r.nodeType==1&&r.contentEditable==`false`}Fp.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,sm(e,20))};function sm(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>dm(e),t))}function cm(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=um());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function lm(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=nd(t.focusNode,t.focusOffset),r=rd(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(!(!e||!e.isText(n.nodeValue)))return r}}return n||r}function um(){let e=document.createEvent(`Event`);return e.initEvent(`event`,!0,!0),e.timeStamp}function dm(e,t=!1){if(!(Ed&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),cm(e),t||e.docView&&e.docView.dirty){let n=Lf(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function fm(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement(`div`));n.appendChild(t),n.style.cssText=`position: fixed; left: -10000px; top: 10px`;let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}var pm=gd&&_d<15||Cd&&Od<604;Pp.copy=Fp.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=pm?null:n.clipboardData,{dom:o,text:s}=_p(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):fm(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))};function mm(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function hm(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?`textarea`:`div`));n||(r.contentEditable=`true`),r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?gm(e,r.value,null,i,t):gm(e,r.textContent,r.innerHTML,i,t)},50)}function gm(e,t,n,r,i){let a=vp(e,t,n,r,e.state.selection.$from);if(e.someProp(`handlePaste`,t=>t(e,i,a||j.empty)))return!0;if(!a)return!1;let o=mm(a),s=o?e.state.tr.replaceSelectionWith(o,r):e.state.tr.replaceSelection(a);return e.dispatch(s.scrollIntoView().setMeta(`paste`,!0).setMeta(`uiEvent`,`paste`)),!0}function _m(e){let t=e.getData(`text/plain`)||e.getData(`Text`);if(t)return t;let n=e.getData(`text/uri-list`);return n?n.replace(/\r?\n/g,` `):``}Fp.paste=(e,t)=>{let n=t;if(e.composing&&!Ed)return;let r=pm?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&gm(e,_m(r),r.getData(`text/html`),i,n)?n.preventDefault():hm(e,n)};var vm=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},ym=wd?`altKey`:`ctrlKey`;function bm(e,t){let n;return e.someProp(`dragCopies`,e=>{n||=e(t)}),n==null?!t[ym]:!n}Pp.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,a=i.empty?null:e.posAtCoords(Gp(n)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof N?i.to-1:i.to))){if(r&&r.mightDrag)o=N.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=N.create(e.state.doc,t.posBefore))}}let{dom:s,text:c,slice:l}=_p(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!bd||xd>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(pm?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,pm||n.dataTransfer.setData(`text/plain`,c),e.dragging=new vm(l,bm(e,n),o)},Pp.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},Fp.dragover=Fp.dragenter=(e,t)=>t.preventDefault(),Fp.drop=(e,t)=>{try{xm(e,t,e.dragging)}finally{e.dragging=null}};function xm(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(Gp(t));if(!r)return;let i=e.state.doc.resolve(r.pos),a=n&&n.slice;a?e.someProp(`transformPasted`,t=>{a=t(a,e,!1)}):a=vp(e,_m(t.dataTransfer),pm?null:t.dataTransfer.getData(`text/html`),!1,i);let o=!!(n&&bm(e,t));if(e.someProp(`handleDrop`,n=>n(e,t,a||j.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let s=a?fc(e.state.doc,i.pos,a):i.pos;s??=i.pos;let c=e.state.tr;if(o){let{node:e}=n;e?e.replace(c):c.deleteSelection()}let l=c.mapping.map(s),u=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=c.doc;if(u?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let f=c.doc.resolve(l);if(u&&N.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new N(f));else{let t=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),c.setSelection(Jf(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta(`uiEvent`,`drop`))}Pp.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add(`ProseMirror-focused`),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&zf(e)},20))},Pp.blur=(e,t)=>{let n=t;e.focused&&=(e.domObserver.stop(),e.dom.classList.remove(`ProseMirror-focused`),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),!1)},Pp.beforeinput=(e,t)=>{if(bd&&Ed&&t.inputType==`deleteContentBackward`){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp(`handleKeyDown`,t=>t(e,sd(8,`Backspace`)))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let e in Fp)Pp[e]=Fp[e];function Sm(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}var Cm=class e{constructor(e,t){this.toDOM=e,this.spec=t||Om,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:a}=e.mapResult(t.from+r,this.side<0?-1:1);return a?null:new Em(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Sm(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},wm=class e{constructor(e,t){this.attrs=e,this.spec=t||Om}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,a=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=a?null:new Em(i,a,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&Sm(this.attrs,t.attrs)&&Sm(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},Tm=class e{constructor(e,t){this.attrs=e,this.spec=t||Om}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let a=e.mapResult(t.to+r,-1);return a.deleted||a.pos<=i.pos?null:new Em(i.pos-n,a.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(t){return this==t||t instanceof e&&Sm(this.attrs,t.attrs)&&Sm(this.spec,t.spec)}destroy(){}},Em=class e{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(t,n){return new e(t,n,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(t,n,r){return new e(t,t,new Cm(n,r))}static inline(t,n,r,i){return new e(t,n,new wm(r,i))}static node(t,n,r,i){return new e(t,n,new Tm(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof wm}get widget(){return this.type instanceof Cm}},Dm=[],Om={},km=class e{constructor(e,t){this.local=e.length?e:Dm,this.children=t.length?t:Dm}static create(e,t){return t.length?Lm(t,e,0,Om):Am}find(e,t,n){let r=[];return this.findInner(e??0,t??1e9,r,0,n),r}findInner(e,t,n,r,i){for(let a=0;a<this.local.length;a++){let o=this.local[a];o.from<=t&&o.to>=e&&(!i||i(o.spec))&&n.push(o.copy(o.from+r,o.to+r))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let o=this.children[a]+1;this.children[a+2].findInner(e-o,t-o,n,r+o,i)}}map(e,t,n){return this==Am||e.maps.length==0?this:this.mapInner(e,t,0,0,n||Om)}mapInner(t,n,r,i,a){let o;for(let e=0;e<this.local.length;e++){let s=this.local[e].map(t,r,i);s&&s.type.valid(n,s)?(o||=[]).push(s):a.onRemove&&a.onRemove(this.local[e].spec)}return this.children.length?Mm(this.children,o||[],t,n,r,i,a):o?new e(o.sort(Rm),Dm):Am}add(t,n){return n.length?this==Am?e.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,a=0;t.forEach((e,t)=>{let o=t+r,s;if(s=Fm(n,e,o)){for(i||=this.children.slice();a<i.length&&i[a]<t;)a+=3;i[a]==t?i[a+2]=i[a+2].addInner(e,s,o+1):i.splice(a,0,t,t+e.nodeSize,Lm(s,e,o+1,Om)),a+=3}});let o=Nm(a?Im(n):n,-r);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||o.splice(e--,1);return new e(o.length?this.local.concat(o).sort(Rm):this.local,i||this.children)}remove(e){return e.length==0||this==Am?this:this.removeInner(e,0)}removeInner(t,n){let r=this.children,i=this.local;for(let e=0;e<r.length;e+=3){let i,a=r[e]+n,o=r[e+1]+n;for(let e=0,n;e<t.length;e++)(n=t[e])&&n.from>a&&n.to<o&&(t[e]=null,(i||=[]).push(n));if(!i)continue;r==this.children&&(r=this.children.slice());let s=r[e+2].removeInner(i,a+1);s==Am?(r.splice(e,3),e-=3):r[e+2]=s}if(i.length){for(let e=0,r;e<t.length;e++)if(r=t[e])for(let e=0;e<i.length;e++)i[e].eq(r,n)&&(i==this.local&&(i=this.local.slice()),i.splice(e--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new e(i,r):Am}forChild(t,n){if(this==Am)return this;if(n.isLeaf)return e.empty;let r,i;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(r=this.children[e+2]);break}let a=t+1,o=a+n.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>a&&t.type instanceof wm){let e=Math.max(a,t.from)-a,n=Math.min(o,t.to)-a;e<n&&(i||=[]).push(t.copy(e,n))}}if(i){let t=new e(i.sort(Rm),Dm);return r?new jm([t,r]):t}return r||Am}eq(t){if(this==t)return!0;if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(e){return zm(this.localsInner(e))}localsInner(e){if(this==Am)return Dm;if(e.inlineContent||!this.local.some(wm.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof wm||t.push(this.local[e]);return t}forEachSet(e){e(this)}};km.empty=new km([],[]),km.removeOverlap=zm;var Am=km.empty,jm=class e{constructor(e){this.members=e}map(t,n){let r=this.members.map(e=>e.map(t,n,Om));return e.from(r)}forChild(t,n){if(n.isLeaf)return km.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,n);a!=Am&&(a instanceof e?r=r.concat(a.members):r.push(a))}return e.from(r)}eq(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(!t)t=i;else{n&&=(t=t.slice(),!1);for(let e=0;e<i.length;e++)t.push(i[e])}}return t?zm(n?t:t.sort(Rm)):Dm}static from(t){switch(t.length){case 0:return Am;case 1:return t[0];default:return new e(t.every(e=>e instanceof km)?t:t.reduce((e,t)=>e.concat(t instanceof km?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}};function Mm(e,t,n,r,i,a,o){let s=e.slice();for(let e=0,t=a;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,a)=>{let o=a-i-(n-e);for(let i=0;i<s.length;i+=3){let a=s[i+1];if(a<0||e>a+t-r)continue;let c=s[i]+t-r;n>=c?s[i+1]=e<=c?-2:-1:e>=t&&o&&(s[i]+=o,s[i+1]+=o)}r+=o}),t=n.maps[e].map(t,-1)}let c=!1;for(let t=0;t<s.length;t+=3)if(s[t+1]<0){if(s[t+1]==-2){c=!0,s[t+1]=-1;continue}let l=n.map(e[t]+a),u=l-i;if(u<0||u>=r.content.size){c=!0;continue}let d=n.map(e[t+1]+a,-1)-i,{index:f,offset:p}=r.content.findIndex(u),m=r.maybeChild(f);if(m&&p==u&&p+m.nodeSize==d){let r=s[t+2].mapInner(n,m,l+1,e[t]+a+1,o);r==Am?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=Lm(Pm(s,e,t,n,i,a,o),r,0,o);t=c.local;for(let e=0;e<s.length;e+=3)s[e+1]<0&&(s.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<s.length&&s[t]<n;)t+=3;s.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new km(t.sort(Rm),s)}function Nm(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new Em(i.from+t,i.to+t,i.type))}return n}function Pm(e,t,n,r,i,a,o){function s(e,t){for(let a=0;a<e.local.length;a++){let s=e.local[a].map(r,i,t);s?n.push(s):o.onRemove&&o.onRemove(e.local[a].spec)}for(let n=0;n<e.children.length;n+=3)s(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)e[n+1]==-1&&s(e[n+2],t[n]+a+1);return n}function Fm(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,a;t<e.length;t++)(a=e[t])&&a.from>n&&a.to<r&&((i||=[]).push(a),e[t]=null);return i}function Im(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Lm(e,t,n,r){let i=[],a=!1;t.forEach((t,o)=>{let s=Fm(e,t,o+n);if(s){a=!0;let e=Lm(s,t,n+o+1,r);e!=Am&&i.push(o,o+t.nodeSize,e)}});let o=Nm(a?Im(e):e,-n).sort(Rm);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||(r.onRemove&&r.onRemove(o[e].spec),o.splice(e--,1));return o.length||i.length?new km(o,i):Am}function Rm(e,t){return e.from-t.from||e.to-t.to}function zm(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let a=t[i];if(a.from==r.from){a.to!=r.to&&(t==e&&(t=e.slice()),t[i]=a.copy(a.from,r.to),Bm(t,i+1,a.copy(r.to,a.to)));continue}else{a.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,a.from),Bm(t,i,r.copy(a.from,r.to)));break}}}return t}function Bm(e,t,n){for(;t<e.length&&Rm(n,e[t])>0;)t++;e.splice(t,0,n)}function Vm(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=Am&&t.push(r)}),e.cursorWrapper&&t.push(km.create(e.state.doc,[e.cursorWrapper.deco])),jm.from(t)}var Hm={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Um=gd&&_d<=11,Wm=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}},Gm=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Wm,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);gd&&_d<=11&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():Sd&&e.composing&&t.some(e=>e.type==`childList`&&e.target.nodeName==`TR`)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),Um&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Hm)),this.onCharData&&this.view.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener(`selectionchange`,this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener(`selectionchange`,this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Yf(this.view)){if(this.suppressingSelectionUpdates)return zf(this.view);if(gd&&_d<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Qu(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let n=e.focusNode;n;n=Ju(n))t.add(n);for(let r=e.anchorNode;r;r=Ju(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Yf(e)&&!this.ignoreSelectionChange(n),i=-1,a=-1,o=!1,s=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],s);n&&(i=i<0?n.from:Math.min(n.from,i),a=a<0?n.to:Math.max(n.to,a),n.typeOver&&(o=!0))}if(s.some(e=>e.nodeName==`BR`)&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let e of s)if(e.nodeName==`BR`&&e.parentNode){let t=e.nextSibling;for(;t&&t.nodeType==1;){if(t.contentEditable==`false`){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(vd&&s.length){let t=s.filter(e=>e.nodeName==`BR`);if(t.length==2){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;t&&t.nodeName==`LI`&&(!n||Zm(e,n)!=t)&&r.remove()}}}let c=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&od(n)&&(c=Lf(e))&&c.eq(Nc.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,zf(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,a),Jm(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,Qm(e,s)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||zf(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type==`attributes`&&(n==this.view.docView||e.attributeName==`contenteditable`||e.attributeName==`style`&&!e.oldValue&&!e.target.getAttribute(`style`))||!n||n.ignoreMutation(e))return null;if(e.type==`childList`){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),r.nodeType==3&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(gd&&_d<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:a}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!a||Array.prototype.indexOf.call(e.addedNodes,a)<0)&&(i=a)}let a=r&&r.parentNode==e.target?qu(r)+1:0,o=n.localPosFromDOM(e.target,a,-1),s=i&&i.parentNode==e.target?qu(i):e.target.childNodes.length;return{from:o,to:n.localPosFromDOM(e.target,s,1)}}else if(e.type==`attributes`)return{from:n.posAtStart-n.border,to:n.posAtEnd+n.border};else return this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}},Km=new WeakMap,qm=!1;function Jm(e){if(!Km.has(e)&&(Km.set(e,null),[`normal`,`nowrap`,`pre-line`].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=vd,qm)return;console.warn(`ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.`),qm=!0}}function Ym(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return Qu(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function Xm(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return Ym(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener(`beforeinput`,r,!0),document.execCommand(`indent`),e.dom.removeEventListener(`beforeinput`,r,!0),n?Ym(e,n):null}function Zm(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function Qm(e,t){let{focusNode:n,focusOffset:r}=e.domSelectionRange();for(let i of t)if(i.parentNode?.nodeName==`TR`){let t=i.nextSibling;for(;t&&t.nodeName!=`TD`&&t.nodeName!=`TH`;)t=t.nextSibling;if(t){let a=t;for(;;){let e=a.firstChild;if(!e||e.nodeType!=1||e.contentEditable==`false`||/^(BR|IMG)$/.test(e.nodeName))break;a=e}a.insertBefore(i,a.firstChild),n==i&&e.domSelection().collapse(i,r)}else i.parentNode.removeChild(i)}}function $m(e,t,n){let{node:r,fromOffset:i,toOffset:a,from:o,to:s}=e.docView.parseRange(t,n),c=e.domSelectionRange(),l,u=c.anchorNode;if(u&&e.dom.contains(u.nodeType==1?u:u.parentNode)&&(l=[{node:u,offset:c.anchorOffset}],od(c)||l.push({node:c.focusNode,offset:c.focusOffset})),bd&&e.input.lastKeyCode===8)for(let e=a;e>i;e--){let t=r.childNodes[e-1],n=t.pmViewDesc;if(t.nodeName==`BR`&&!n){a=e;break}if(!n||n.size)break}let d=e.state.doc,f=e.someProp(`domParser`)||Qo.fromSchema(e.state.schema),p=d.resolve(o),m=null,h=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:a,preserveWhitespace:p.parent.type.whitespace==`pre`?`full`:!0,findPositions:l,ruleFromNode:eh,context:p});if(l&&l[0].pos!=null){let e=l[0].pos,t=l[1]&&l[1].pos;t??=e,m={anchor:e+o,head:t+o}}return{doc:h,sel:m,from:o,to:s}}function eh(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName==`BR`&&e.parentNode){if(Sd&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement(`div`);return e.appendChild(document.createElement(`li`)),{skip:e}}else if(e.parentNode.lastChild==e||Sd&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName==`IMG`&&e.getAttribute(`mark-placeholder`))return{ignore:!0};return null}var th=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function nh(e,t,n,r,i){let a=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Lf(e,t);if(n&&!e.state.selection.eq(n)){if(bd&&Ed&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp(`handleKeyDown`,t=>t(e,sd(13,`Enter`))))return;let r=e.state.tr.setSelection(n);t==`pointer`?r.setMeta(`pointer`,!0):t==`key`&&r.scrollIntoView(),a&&r.setMeta(`composition`,a),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let c=e.state.selection,l=$m(e,t,n),u=e.state.doc,d=u.slice(l.from,l.to),f,p;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,p=`end`):(f=e.state.selection.from,p=`start`),e.input.lastKeyCode=null;let m=sh(d.content,l.doc.content,l.from,f,p);if(m&&e.input.domChangeCount++,(Cd&&e.input.lastIOSEnter>Date.now()-225||Ed)&&i.some(e=>e.nodeType==1&&!th.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,sd(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof M&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(l.sel){let t=rh(e,e.state.doc,l.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);a&&n.setMeta(`composition`,a),e.dispatch(n)}}return}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof M&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=l.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),gd&&_d<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>l.from&&l.doc.textBetween(m.start-l.from-1,m.start-l.from+1)==` \xA0`&&(m.start--,m.endA--,m.endB--);let h=l.doc.resolveNoCache(m.start-l.from),g=l.doc.resolveNoCache(m.endB-l.from),_=u.resolve(m.start),v=h.sameParent(g)&&h.parent.inlineContent&&_.end()>=m.endA;if((Cd&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!v&&h.pos<l.doc.content.size&&(!h.sameParent(g)||!h.parent.inlineContent)&&h.pos<g.pos&&!/\S/.test(l.doc.textBetween(h.pos,g.pos,``,``)))&&e.someProp(`handleKeyDown`,t=>t(e,sd(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&ah(u,m.start,m.endA,h,g)&&e.someProp(`handleKeyDown`,t=>t(e,sd(8,`Backspace`)))){Ed&&bd&&e.domObserver.suppressSelectionUpdates();return}bd&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),Ed&&!v&&h.start()!=g.start()&&g.parentOffset==0&&h.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==m.endA&&(m.endB-=2,g=l.doc.resolveNoCache(m.endB-l.from),setTimeout(()=>{e.someProp(`handleKeyDown`,function(t){return t(e,sd(13,`Enter`))})},20));let y=m.start,b=m.endA,x=t=>{let n=t||e.state.tr.replace(y,b,l.doc.slice(m.start-l.from,m.endB-l.from));if(l.sel){let t=rh(e,n.doc,l.sel);t&&!(bd&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==y||t.head==n.mapping.map(b)-1)||gd&&t.empty&&t.head==y)&&n.setSelection(t)}return a&&n.setMeta(`composition`,a),n.scrollIntoView()},S;if(v)if(h.pos==g.pos){gd&&_d<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>zf(e),20));let t=x(e.state.tr.delete(y,b)),n=u.resolve(m.start).marksAcross(u.resolve(m.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(m.endA==m.endB&&(S=ih(h.parent.content.cut(h.parentOffset,g.parentOffset),_.parent.content.cut(_.parentOffset,m.endA-_.start())))){let t=x(e.state.tr);S.type==`add`?t.addMark(y,b,S.mark):t.removeMark(y,b,S.mark),e.dispatch(t)}else if(h.parent.child(h.index()).isText&&h.index()==g.index()-+!g.textOffset){let t=h.parent.textBetween(h.parentOffset,g.parentOffset),n=()=>x(e.state.tr.insertText(t,y,b));e.someProp(`handleTextInput`,r=>r(e,y,b,t,n))||e.dispatch(n())}else e.dispatch(x());else e.dispatch(x())}function rh(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Jf(e,t.resolve(n.anchor),t.resolve(n.head))}function ih(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,a=r,o,s,c;for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);for(let e=0;e<n.length;e++)a=n[e].removeFromSet(a);if(i.length==1&&a.length==0)s=i[0],o=`add`,c=e=>e.mark(s.addToSet(e.marks));else if(i.length==0&&a.length==1)s=a[0],o=`remove`,c=e=>e.mark(s.removeFromSet(e.marks));else return null;let l=[];for(let e=0;e<t.childCount;e++)l.push(c(t.child(e)));if(A.from(l).eq(e))return{mark:s,type:o}}function ah(e,t,n,r,i){if(n-t<=i.pos-r.pos||oh(r,!0,!1)<i.pos)return!1;let a=e.resolve(t);if(!r.parent.isTextblock){let e=a.nodeAfter;return e!=null&&n==t+e.nodeSize}if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let o=e.resolve(oh(a,!0,!0));return!o.parent.isTextblock||o.pos>n||oh(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function oh(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function sh(e,t,n,r,i){let a=e.findDiffStart(t,n);if(a==null)return null;let{a:o,b:s}=e.findDiffEnd(t,n+e.size,n+t.size);if(i==`end`){let e=Math.max(0,a-Math.min(o,s));r-=o+e-a}if(o<a&&e.size<t.size){let e=r<=a&&r>=o?a-r:0;a-=e,a&&a<t.size&&ch(t.textBetween(a-1,a+1))&&(a+=e?1:-1),s=a+(s-o),o=a}else if(s<a){let t=r<=a&&r>=s?a-r:0;a-=t,a&&a<e.size&&ch(e.textBetween(a-1,a+1))&&(a+=t?1:-1),o=a+(o-s),s=a}return{start:a,endA:o,endB:s}}function ch(e){if(e.length!=2)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}var lh=class{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Lp,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(gh),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement(`div`),e&&(e.appendChild?e.appendChild(this.dom):typeof e==`function`?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=fh(this),dh(this),this.nodeViews=mh(this),this.docView=_f(this.state.doc,uh(this),Vm(this),this.dom,this),this.domObserver=new Gm(this,(e,t,n,r)=>nh(this,e,t,n,r)),this.domObserver.start(),Rp(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Vp(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(gh),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;e.storedMarks&&this.composing&&(cm(this),i=!0),this.state=e;let a=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=mh(this);hh(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&Vp(this),this.editable=fh(this),dh(this);let o=Vm(this),s=uh(this),c=n.plugins!=e.plugins&&!n.doc.eq(e.doc)?`reset`:e.scrollToSelection>n.scrollToSelection?`to selection`:`preserve`,l=r||!this.docView.matchesNode(e.doc,s,o);(l||!e.selection.eq(n.selection))&&(i=!0);let u=c==`preserve`&&i&&this.dom.style.overflowAnchor==null&&Nd(this);if(i){this.domObserver.stop();let t=l&&(gd||bd)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&ph(n.selection,e.selection);if(l){let n=bd?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=lm(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=_f(e.doc,s,o,this.dom,this)),n&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Zf(this))?zf(this,t):(Kf(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),this.dragging?.node&&!n.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,n),c==`reset`?this.dom.scrollTop=0:c==`to selection`?this.scrollToSelection():u&&Fd(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))&&!this.someProp(`handleScrollToSelection`,e=>e(this)))if(this.state.selection instanceof N){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&Md(this,t.getBoundingClientRect(),e)}else Md(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}updateDraggedNode(e,t){let n=e.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new vm(e.slice,e.move,r<0?void 0:N.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(n!=null&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(i!=null&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let a=i[n].props[e];if(a!=null&&(r=t?t(a):a))return r}}hasFocus(){if(gd){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable==`false`)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&Rd(this.dom),zf(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let e=this.dom.parentNode;e;e=e.parentNode)if(e.nodeType==9||e.nodeType==11&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Kd(this,e)}coordsAtPos(e,t=1){return Xd(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(r==null)throw RangeError(`DOM position not inside the editor`);return r}endOfTextblock(e,t){return sf(this,t||this.state,e)}pasteHTML(e,t){return gm(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return gm(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return _p(this,e)}destroy(){this.docView&&(Bp(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Vm(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Zu())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Wp(this,e)}domSelectionRange(){let e=this.domSelection();return e?Sd&&this.root.nodeType===11&&cd(this.dom.ownerDocument)==this.dom&&Xm(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};lh.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function uh(e){let t=Object.create(null);return t.class=`ProseMirror`,t.contenteditable=String(e.editable),e.someProp(`attributes`,n=>{if(typeof n==`function`&&(n=n(e.state)),n)for(let e in n)e==`class`?t.class+=` `+n[e]:e==`style`?t.style=(t.style?t.style+`;`:``)+n[e]:!t[e]&&e!=`contenteditable`&&e!=`nodeName`&&(t[e]=String(n[e]))}),t.translate||=`no`,[Em.node(0,e.state.doc.content.size,t)]}function dh(e){if(e.markCursor){let t=document.createElement(`img`);t.className=`ProseMirror-separator`,t.setAttribute(`mark-placeholder`,`true`),t.setAttribute(`alt`,``),e.cursorWrapper={dom:t,deco:Em.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function fh(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function ph(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function mh(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp(`nodeViews`,n),e.someProp(`markViews`,n),t}function hh(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r}function gh(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError(`Plugins passed directly to the view must not have a state component`)}function _h(e,t){return e.meta={package:`@milkdown/core`,group:`System`,...t},e}var vh={text:(e,t,n,r)=>{let i=e.value;return/^[^*_\\]*\s+$/.test(i)?i:n.safe(i,{...r,encode:[]})},strong:(e,t,n,r)=>{let i=e.marker||n.options.strong||`*`,a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i);return s+=o.move(n.containerPhrasing(e,{before:s,after:i,...o.current()})),s+=o.move(i+i),a(),s},emphasis:(e,t,n,r)=>{let i=e.marker||n.options.emphasis||`*`,a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i);return s+=o.move(n.containerPhrasing(e,{before:s,after:i,...o.current()})),s+=o.move(i),a(),s}},yh=_e({},`editorView`),bh=_e({},`editorState`),xh=_e([],`initTimer`),Sh=_e({},`editor`),Ch=_e([],`inputRules`),wh=_e([],`prosePlugins`),Th=_e([],`remarkPlugins`),Eh=_e([],`nodeView`),Dh=_e([],`markView`),Oh=_e(Ba().use(Or).use(da),`remark`),kh=_e({handlers:vh,encode:[]},`remarkStringifyOptions`),Ah=Ce(`ConfigReady`);function jh(e){let t=t=>(t.record(Ah),async()=>(await e(t),t.done(Ah),()=>{t.clearTimer(Ah)}));return _h(t,{displayName:`Config`}),t}var Mh=Ce(`InitReady`);function Nh(e){let t=t=>(t.inject(Sh,e).inject(wh,[]).inject(Th,[]).inject(Ch,[]).inject(Eh,[]).inject(Dh,[]).inject(kh,{handlers:vh,encode:[]}).inject(Oh,Ba().use(Or).use(da)).inject(xh,[Ah]).record(Mh),async()=>{await t.waitTimers(xh);let e=t.get(kh);return t.set(Oh,Ba().use(Or).use(da,e)),t.done(Mh),()=>{t.remove(Sh).remove(wh).remove(Th).remove(Ch).remove(Eh).remove(Dh).remove(kh).remove(Oh).remove(xh).clearTimer(Mh)}});return _h(t,{displayName:`Init`}),t}var Ph=Ce(`SchemaReady`),Fh=_e([],`schemaTimer`),Ih=_e({},`schema`),Lh=_e([],`nodes`),Rh=_e([],`marks`);function zh(e){return{...e,parseDOM:e.parseDOM?.map(t=>({priority:e.priority,...t}))}}var Bh=e=>(e.inject(Ih,{}).inject(Lh,[]).inject(Rh,[]).inject(Fh,[Mh]).record(Ph),async()=>{await e.waitTimers(Fh);let t=e.get(Oh),n=e.get(Th).reduce((e,t)=>e.use(t.plugin,t.options),t);e.set(Oh,n);let r=new Jo({nodes:Object.fromEntries(e.get(Lh).map(([e,t])=>[e,zh(t)])),marks:Object.fromEntries(e.get(Rh).map(([e,t])=>[e,zh(t)]))});return e.set(Ih,r),e.done(Ph),()=>{e.remove(Ih).remove(Lh).remove(Rh).remove(Fh).clearTimer(Ph)}});_h(Bh,{displayName:`Schema`});var Vh=class{constructor(){this.#e=new me,this.#t=null,this.setCtx=e=>{this.#t=e},this.chain=()=>{if(this.#t==null)throw de();let e=this.#t,t=[],n=this.get.bind(this),r={run:()=>{let n=Nl(...t),r=e.get(yh);return n(r.state,r.dispatch,r)},inline:e=>(t.push(e),r),pipe:i.bind(this)};function i(e,i){let a=n(e);return t.push(a(i)),r}return r}}#e;#t;get ctx(){return this.#t}create(e,t){let n=e.create(this.#e.sliceMap);return n.set(t),n}get(e){return this.#e.get(e).get()}remove(e){return this.#e.remove(e)}call(e,t){if(this.#t==null)throw de();let n=this.get(e)(t),r=this.#t.get(yh);return n(r.state,r.dispatch,r)}inline(e){if(this.#t==null)throw de();let t=this.#t.get(yh);return e(t.state,t.dispatch,t)}};function Hh(e=`cmdKey`){return _e((()=>()=>!1),e)}var Uh=_e(new Vh,`commands`),Wh=_e([Ph],`commandsTimer`),Gh=Ce(`CommandsReady`),Kh=e=>{let t=new Vh;return t.setCtx(e),e.inject(Uh,t).inject(Wh,[Ph]).record(Gh),async()=>(await e.waitTimers(Wh),e.done(Gh),()=>{e.remove(Uh).remove(Wh).clearTimer(Gh)})};_h(Kh,{displayName:`Commands`});function qh(e){return e.Backspace=Nl(Vl,rl,ol,ll),e}var Jh=class{constructor(){this.#e=null,this.#t=[],this.setCtx=e=>{this.#e=e},this.add=e=>(this.#t.push(e),()=>{this.#t=this.#t.filter(t=>t!==e)}),this.addObjectKeymap=e=>{let t=[];return Object.entries(e).forEach(([e,n])=>{if(typeof n==`function`){let r={key:e,onRun:()=>n};this.#t.push(r),t.push(()=>{this.#t=this.#t.filter(e=>e!==r)})}else this.#t.push(n),t.push(()=>{this.#t=this.#t.filter(e=>e!==n)})}),()=>{t.forEach(e=>e())}},this.addBaseKeymap=()=>{let e=qh(Rl);return this.addObjectKeymap(e)},this.build=()=>{let e={};return this.#t.forEach(t=>{e[t.key]=[...e[t.key]||[],t]}),Object.fromEntries(Object.entries(e).map(([e,t])=>{let n=t.sort((e,t)=>(t.priority??50)-(e.priority??50));return[e,(e,t,r)=>{let i=this.#e;if(i==null)throw ae();return Nl(...n.map(e=>e.onRun(i)))(e,t,r)}]}))}}#e;#t;get ctx(){return this.#e}},Yh=_e(new Jh,`keymap`),Xh=_e([Ph],`keymapTimer`),Zh=Ce(`KeymapReady`),Qh=e=>{let t=new Jh;return t.setCtx(e),e.inject(Yh,t).inject(Xh,[Ph]).record(Zh),async()=>(await e.waitTimers(Xh),e.done(Zh),()=>{e.remove(Yh).remove(Xh).clearTimer(Zh)})},$h=Ce(`ParserReady`),eg=(()=>{throw ae()}),tg=_e(eg,`parser`),ng=_e([],`parserTimer`),rg=e=>(e.inject(tg,eg).inject(ng,[Ph]).record($h),async()=>{await e.waitTimers(ng);let t=e.get(Oh),n=e.get(Ih);return e.set(tg,Uu.create(n,t)),e.done($h),()=>{e.remove(tg).remove(ng).clearTimer($h)}});_h(rg,{displayName:`Parser`});var ig=Ce(`SerializerReady`),ag=_e([],`serializerTimer`),og=(()=>{throw ae()}),sg=_e(og,`serializer`),cg=e=>(e.inject(sg,og).inject(ag,[Ph]).record(ig),async()=>{await e.waitTimers(ag);let t=e.get(Oh),n=e.get(Ih);return e.set(sg,Ku.create(n,t)),e.done(ig),()=>{e.remove(sg).remove(ag).clearTimer(ig)}});_h(cg,{displayName:`Serializer`});var lg=_e(``,`defaultValue`),ug=_e(e=>e,`stateOptions`),dg=_e([],`editorStateTimer`),fg=Ce(`EditorStateReady`);function pg(e,t,n){if(typeof e==`string`)return t(e);if(e.type===`html`)return Qo.fromSchema(n).parse(e.dom);if(e.type===`json`)return Co.fromJSON(n,e.value);throw ne(e)}var mg=new nl(`MILKDOWN_STATE_TRACKER`),hg=e=>(e.inject(lg,``).inject(bh,{}).inject(ug,e=>e).inject(dg,[$h,ig,Gh,Zh]).record(fg),async()=>{await e.waitTimers(dg);let t=e.get(Ih),n=e.get(tg),r=e.get(Ch),i=e.get(ug),a=e.get(wh),o=pg(e.get(lg),n,t),s=e.get(Yh),c=s.addBaseKeymap(),l=[...a,new $c({key:mg,state:{init:()=>{},apply:(t,n,r,i)=>{e.set(bh,i)}}}),nu({rules:r}),Ru(s.build())];e.set(wh,l);let u=i({schema:t,doc:o,plugins:l}),d=Zc.create(u);return e.set(bh,d),e.done(fg),()=>{c(),e.remove(lg).remove(bh).remove(ug).remove(dg).clearTimer(fg)}});_h(hg,{displayName:`EditorState`});var gg=_e([],`pasteRule`),_g=_e([Ph],`pasteRuleTimer`),vg=Ce(`PasteRuleReady`),yg=e=>(e.inject(gg,[]).inject(_g,[Ph]).record(vg),async()=>(await e.waitTimers(_g),e.done(vg),()=>{e.remove(gg).remove(_g).clearTimer(vg)}));_h(yg,{displayName:`PasteRule`});var bg=Ce(`EditorViewReady`),xg=_e([],`editorViewTimer`),Sg=_e({},`editorViewOptions`),Cg=_e(null,`root`),wg=_e(null,`rootDOM`),Tg=_e({},`rootAttrs`);function Eg(e,t){let n=document.createElement(`div`);n.className=`milkdown`,e.appendChild(n),t.set(wg,n);let r=t.get(Tg);return Object.entries(r).forEach(([e,t])=>n.setAttribute(e,t)),n}function Dg(e){e.classList.add(`editor`),e.setAttribute(`role`,`textbox`)}var Og=new nl(`MILKDOWN_VIEW_CLEAR`),kg=e=>(e.inject(Cg,document.body).inject(yh,{}).inject(Sg,{}).inject(wg,null).inject(Tg,{}).inject(xg,[fg,vg]).record(bg),async()=>{await e.wait(Mh);let t=e.get(Cg)||document.body,n=typeof t==`string`?document.querySelector(t):t;e.update(wh,t=>[new $c({key:Og,view:t=>{let r=n?Eg(n,e):void 0;return(()=>{if(r&&n){let e=t.dom;n.replaceChild(r,e),r.appendChild(e)}})(),{destroy:()=>{r?.parentNode&&r?.parentNode.replaceChild(t.dom,r),r?.remove()}}}}),...t]),await e.waitTimers(xg);let r=e.get(bh),i=e.get(Sg),a=new lh(n,{state:r,nodeViews:Object.fromEntries(e.get(Eh)),markViews:Object.fromEntries(e.get(Dh)),transformPasted:(t,n,r)=>(e.get(gg).sort((e,t)=>(t.priority??50)-(e.priority??50)).map(e=>e.run).forEach(e=>{t=e(t,n,r)}),t),...i});return Dg(a.dom),e.set(yh,a),e.done(bg),()=>{a?.destroy(),e.remove(Cg).remove(yh).remove(Sg).remove(wg).remove(Tg).remove(xg).clearTimer(bg)}});_h(kg,{displayName:`EditorView`});var Ag=function(e){return e.Idle=`Idle`,e.OnCreate=`OnCreate`,e.Created=`Created`,e.OnDestroy=`OnDestroy`,e.Destroyed=`Destroyed`,e}({}),jg=class e{constructor(){this.#e=!1,this.#t=Ag.Idle,this.#n=[],this.#r=()=>void 0,this.#i=new me,this.#a=new be,this.#o=new Map,this.#s=new Map,this.#c=new ye(this.#i,this.#a),this.#l=()=>{let e=jh(async e=>{await Promise.all(this.#n.map(t=>Promise.resolve(t(e))))}),t=[Bh,rg,cg,Kh,Qh,yg,hg,kg,Nh(this),e];this.#u(t,this.#s)},this.#u=(e,t)=>{e.forEach(e=>{let n=this.#c.produce(this.#e?e.meta:void 0),r=e(n);t.set(e,{ctx:n,handler:r,cleanup:void 0})})},this.#d=(e,t=!1)=>Promise.all([e].flat().map(async e=>{let n=this.#o.get(e)?.cleanup;return t?this.#o.delete(e):this.#o.set(e,{ctx:void 0,handler:void 0,cleanup:void 0}),typeof n==`function`?n():n})),this.#f=async()=>{await Promise.all([...this.#s.entries()].map(async([e,{cleanup:t}])=>typeof t==`function`?t():t)),this.#s.clear()},this.#p=e=>{this.#t=e,this.#r(e)},this.#m=e=>[...e.entries()].map(async([t,n])=>{let{ctx:r,handler:i}=n;if(!i)return;let a=await i();e.set(t,{ctx:r,handler:i,cleanup:a})}),this.enableInspector=(e=!0)=>(this.#e=e,this),this.onStatusChange=e=>(this.#r=e,this),this.config=e=>(this.#n.push(e),this),this.removeConfig=e=>(this.#n=this.#n.filter(t=>t!==e),this),this.use=e=>{let t=[e].flat();return t.flat().forEach(e=>{this.#o.set(e,{ctx:void 0,handler:void 0,cleanup:void 0})}),this.#t===Ag.Created&&this.#u(t,this.#o),this},this.remove=async e=>this.#t===Ag.OnCreate?(console.warn(`[Milkdown]: You are trying to remove plugins when the editor is creating, this is not recommended, please check your code.`),new Promise(t=>{setTimeout(()=>{t(this.remove(e))},50)})):(await this.#d([e].flat(),!0),this),this.create=async()=>this.#t===Ag.OnCreate?this:(this.#t===Ag.Created&&await this.destroy(),this.#p(Ag.OnCreate),this.#l(),this.#u([...this.#o.keys()],this.#o),await Promise.all([this.#m(this.#s),this.#m(this.#o)].flat()),this.#p(Ag.Created),this),this.destroy=async(e=!1)=>this.#t===Ag.Destroyed||this.#t===Ag.OnDestroy?this:this.#t===Ag.OnCreate?new Promise(t=>{setTimeout(()=>{t(this.destroy(e))},50)}):(e&&(this.#n=[]),this.#p(Ag.OnDestroy),await this.#d([...this.#o.keys()],e),await this.#f(),this.#p(Ag.Destroyed),this),this.action=e=>e(this.#c),this.inspect=()=>this.#e?[...this.#s.values(),...this.#o.values()].map(({ctx:e})=>e?.inspector?.read()).filter(e=>!!e):(console.warn("[Milkdown]: You are trying to collect inspection when inspector is disabled, please enable inspector by `editor.enableInspector()` first."),[])}static make(){return new e}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;get ctx(){return this.#c}get status(){return this.#t}},Mg=e=>crypto.getRandomValues(new Uint8Array(e)),Ng=(e,t,n)=>{let r=256-256%e.length;if(r===256){let r=e.length-1;return(i=t)=>{if(!i)return``;let a=``;for(;;){let t=n(i),o=i;for(;o--;)if(a+=e[t[o]&r],a.length>=i)return a}}}let i=Math.ceil(1.6*256*t/r);return(a=t)=>{if(!a)return``;let o=``;for(;;){let t=n(i),s=i;for(;s--;)if(t[s]<r&&(o+=e[t[s]%e.length],o.length>=a))return o}}};((e,t=21)=>Ng(e,t|0,Mg))(`abcedfghicklmn`,10);function Pg(e,t){let n=Hh(e),r=i=>async()=>{r.key=n,await i.wait(Gh);let a=t(i);return i.get(Uh).create(n,a),r.run=t=>i.get(Uh).call(e,t),()=>{i.get(Uh).remove(n)}};return r}function Fg(e){let t=n=>async()=>{await n.wait(Ph);let r=e(n);return n.update(Ch,e=>[...e,r]),t.inputRule=r,()=>{n.update(Ch,e=>e.filter(e=>e!==r))}};return t}function Ig(e){let t=n=>async()=>{await n.wait(Ph);let r=e(n);return n.update(gg,e=>[...e,r]),t.pasteRule=r,()=>{n.update(gg,e=>e.filter(e=>e!==r))}};return t}function Lg(e,t){let n=r=>async()=>{let i=t(r);return r.update(Rh,t=>[...t.filter(t=>t[0]!==e),[e,i]]),n.id=e,n.schema=i,()=>{r.update(Rh,t=>t.filter(([t])=>t!==e))}};return n.type=t=>{let n=t.get(Ih).marks[e];if(!n)throw pe(e);return n},n}function Rg(e,t){let n=r=>async()=>{let i=t(r);return r.update(Lh,t=>[...t.filter(t=>t[0]!==e),[e,i]]),n.id=e,n.schema=i,()=>{r.update(Lh,t=>t.filter(([t])=>t!==e))}};return n.type=t=>{let n=t.get(Ih).nodes[e];if(!n)throw fe(e);return n},n}function zg(e){let t,n=n=>async()=>(await n.wait(Ph),t=e(n),n.update(wh,e=>[...e,t]),()=>{n.update(wh,e=>e.filter(e=>e!==t))});return n.plugin=()=>t,n.key=()=>t.spec.key,n}function Bg(e){let t=n=>async()=>{await n.wait(Zh);let r=n.get(Yh),i=e(n),a=r.addObjectKeymap(i);return t.keymap=i,()=>{a()}};return t}function Vg(e,t){let n=_e(e,t),r=e=>(e.inject(n),()=>()=>{e.remove(n)});return r.key=n,r}function Hg(e,t){let n=Vg(t,e),r=Rg(e,e=>e.get(n.key)(e)),i=[n,r];return i.id=r.id,i.node=r,i.type=e=>r.type(e),i.ctx=n,i.key=n.key,i.extendSchema=n=>Hg(e,n(t)),i}function Ug(e,t){let n=Vg(t,e),r=Lg(e,e=>e.get(n.key)(e)),i=[n,r];return i.id=r.id,i.mark=r,i.type=e=>r.type(e),i.ctx=n,i.key=n.key,i.extendSchema=n=>Ug(e,n(t)),i}function Wg(e,t){let n=Vg(Object.fromEntries(Object.entries(t).map(([e,{shortcuts:t,priority:n}])=>[e,{shortcuts:t,priority:n}])),`${e}Keymap`),r=Bg(e=>{let r=e.get(n.key),i=Object.entries(t).flatMap(([e,{command:t}])=>{let n=r[e],i=[n.shortcuts].flat(),a=n.priority;return i.map(e=>[e,{key:e,onRun:t,priority:a}])});return Object.fromEntries(i)}),i=[n,r];return i.ctx=n,i.shortcuts=r,i.key=n.key,i.keymap=r.keymap,i}var Gg=(e,t=()=>({}))=>Vg(t,`${e}Attr`),Kg=(e,t=()=>({}))=>Vg(t,`${e}Attr`);function qg(e,t,n){let r=Vg(n??{},e),i=e=>async()=>{await e.wait(Mh);let n={plugin:t(e),options:e.get(r.key)};return e.update(Th,e=>[...e,n]),()=>{e.update(Th,e=>e.filter(e=>e!==n))}},a=[r,i];return a.id=e,a.plugin=i,a.options=r,a}function Jg(e,t=!1){return n=>{let r=n.get(yh),i=n.get(tg)(e);if(!i)return;if(!t){let{state:e}=r;return r.dispatch(e.tr.replace(0,e.doc.content.size,new j(i.content,0,0)))}let a=n.get(Ih),o=n.get(ug)({schema:a,doc:i,plugins:n.get(wh)}),s=Zc.create(o);r.updateState(s)}}function Yg(e){if(!e)return!1;if(Array.isArray(e))return e.length>1?!1:Yg(e[0]);let t=e.content;return t?Yg(t):e.type===`text`}function Xg(e,t){return Object.assign(e,{meta:{package:`@milkdown/plugin-clipboard`,...t}}),e}function Zg(e,t){let n=_u(t);if(n)return e.dispatch(e.state.tr.replaceSelectionWith(n,!0)),!0;try{return e.dispatch(e.state.tr.replaceSelection(t)),!0}catch{return!1}}var Qg=zg(e=>{let t=e.get(Ih);return e.update(Sg,e=>({...e,editable:e.editable??(()=>!0),transformPastedHTML:(t,n)=>{let r=e.transformPastedHTML;return r&&(t=r(t,n)),t.includes(`docs-internal-guid`)&&(t=t.replace(/<b[^>]*id="docs-internal-guid[^"]*"[^>]*>([\s\S]*)<\/b>/,`$1`),t=t.replace(/<div[^>]*>(<table[\s\S]*?<\/table>)<\/div>/g,`$1`)),t}})),new $c({key:new nl(`MILKDOWN_CLIPBOARD`),props:{handlePaste:(n,r,i)=>{let a=e.get(tg),o=n.props.editable?.(n.state),{clipboardData:s}=r;if(!o||!s||n.state.selection.$from.node().type.spec.code)return!1;let c=s.getData(`text/plain`),l=s.getData(`vscode-editor-data`);if(l){let e=JSON.parse(l)?.mode;if(c&&e){let{tr:r}=n.state,i=Su(`code_block`,t);return r.replaceSelectionWith(i.create({language:e})).setSelection(M.near(r.doc.resolve(Math.max(0,r.selection.from-2)))).insertText(c.replace(/\r\n?/g,`
|
|
45
|
+
`)),n.dispatch(r),!0}}let u=s.getData(`text/html`);if(u.length===0&&c.length===0)return!1;if(u.length>0&&i)return Zg(n,i);let d=Qo.fromSchema(t),f;if(u.length===0){let e=a(c);if(!e||typeof e==`string`)return!1;f=ps.fromSchema(t).serializeFragment(e.content)}else{let e=document.createElement(`template`);e.innerHTML=u,f=e.content.cloneNode(!0),e.remove()}return Zg(n,d.parseSlice(f))},clipboardTextSerializer:n=>{let r=e.get(sg);if(Yg(n.content.toJSON()))return n.content.textBetween(0,n.content.size,`
|
|
46
|
+
|
|
47
|
+
`);let i=t.topNodeType.createAndFill(void 0,n.content);return i?r(i):``}}})});Xg(Qg,{displayName:`Prose<clipboard>`});var $g=200,e_=function(){};e_.prototype.append=function(e){return e.length?(e=e_.from(e),!this.length&&e||e.length<$g&&this.leafAppend(e)||this.length<$g&&e.leafPrepend(this)||this.appendInner(e)):this},e_.prototype.prepend=function(e){return e.length?e_.from(e).append(this):this},e_.prototype.appendInner=function(e){return new n_(this,e)},e_.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?e_.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},e_.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},e_.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},e_.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},e_.from=function(e){return e instanceof e_?e:e&&e.length?new t_(e):e_.empty};var t_=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=$g)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=$g)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(e_);e_.empty=new t_([]);var n_=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(e_),r_=500,i_=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new o_(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new o_(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new o_(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>c_&&(s=a_(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new js;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new o_(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new o_(i,o,l))}else r.push(new o_(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new o_(a.maps[e]));let u=new e(this.items.slice(0,i).append(l).append(r),s);return u.emptyItemCount()>r_&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new o_(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(e_.from(i.reverse()),a)}};i_.empty=new i_(e_.empty,0);function a_(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var o_=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},s_=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},c_=20;function l_(e,t,n,r){let i=n.getMeta(__),a;if(i)return i.historyState;n.getMeta(v_)&&(e=new s_(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(__))return o.getMeta(__).redo?new s_(e.done.addTransform(n,void 0,r,g_(t)),e.undone,d_(n.mapping.maps),e.prevTime,e.prevComposition):new s_(e.done,e.undone.addTransform(n,void 0,r,g_(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!u_(n,e.prevRanges)),s=o?f_(e.prevRanges,n.mapping):d_(n.mapping.maps);return new s_(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,g_(t)),i_.empty,s,n.time,i??e.prevComposition)}else if(a=n.getMeta(`rebased`))return new s_(e.done.rebased(n,a),e.undone.rebased(n,a),f_(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new s_(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),f_(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function u_(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function d_(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function f_(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function p_(e,t,n){let r=g_(t),i=__.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new s_(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(__,{redo:n,historyState:c})}var m_=!1,h_=null;function g_(e){let t=e.plugins;if(h_!=t){m_=!1,h_=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){m_=!0;break}}return m_}var __=new nl(`history`),v_=new nl(`closeHistory`);function y_(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new $c({key:__,state:{init(){return new s_(i_.empty,i_.empty,null,0,-1)},apply(t,n,r){return l_(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?x_:n==`historyRedo`?S_:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function b_(e,t){return(n,r)=>{let i=__.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=p_(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var x_=b_(!1,!0),S_=b_(!0,!0);function C_(e,t){return Object.assign(e,{meta:{package:`@milkdown/plugin-history`,...t}}),e}var w_=Pg(`Undo`,()=>()=>x_);C_(w_,{displayName:`Command<undo>`});var T_=Pg(`Redo`,()=>()=>S_);C_(T_,{displayName:`Command<redo>`});var E_=Vg({},`historyProviderConfig`);C_(E_,{displayName:`Ctx<historyProviderConfig>`});var D_=zg(e=>y_(e.get(E_.key)));C_(D_,{displayName:`Ctx<historyProviderPlugin>`});var O_=Wg(`historyKeymap`,{Undo:{shortcuts:`Mod-z`,command:e=>{let t=e.get(Uh);return()=>t.call(w_.key)}},Redo:{shortcuts:[`Mod-y`,`Shift-Mod-z`],command:e=>{let t=e.get(Uh);return()=>t.call(T_.key)}}});C_(O_.ctx,{displayName:`KeymapCtx<history>`}),C_(O_.shortcuts,{displayName:`Keymap<history>`});var k_=[E_,D_,O_,w_,T_].flat();function A_(e,t){let{doc:n,selection:r}=e;if(!n||!r||!(r instanceof M||r instanceof zc))return e;let{to:i}=r,a=t.type===`space`?Array(t.size).fill(` `).join(``):` `;return e.insertText(a,i)}var j_=Vg({type:`space`,size:2},`indentConfig`);j_.meta={package:`@milkdown/plugin-indent`,displayName:`Ctx<indentConfig>`};var M_=Bg(e=>({Tab:(t,n)=>{let r=e.get(j_.key),{tr:i}=t,a=A_(i,r);return a.docChanged?(n?.(a),!0):!1}}));M_.meta={package:`@milkdown/plugin-indent`,displayName:`Shortcut<indent>`};var N_=[j_,M_],P_=typeof global==`object`&&global&&global.Object===Object&&global,F_=typeof self==`object`&&self&&self.Object===Object&&self,I_=P_||F_||Function(`return this`)(),L_=I_.Symbol,R_=Object.prototype,z_=R_.hasOwnProperty,B_=R_.toString,V_=L_?L_.toStringTag:void 0;function H_(e){var t=z_.call(e,V_),n=e[V_];try{e[V_]=void 0;var r=!0}catch{}var i=B_.call(e);return r&&(t?e[V_]=n:delete e[V_]),i}var U_=Object.prototype.toString;function W_(e){return U_.call(e)}var G_=`[object Null]`,K_=`[object Undefined]`,q_=L_?L_.toStringTag:void 0;function J_(e){return e==null?e===void 0?K_:G_:q_&&q_ in Object(e)?H_(e):W_(e)}function Y_(e){return typeof e==`object`&&!!e}var X_=`[object Symbol]`;function Z_(e){return typeof e==`symbol`||Y_(e)&&J_(e)==X_}var Q_=/\s/;function $_(e){for(var t=e.length;t--&&Q_.test(e.charAt(t)););return t}var ev=/^\s+/;function tv(e){return e&&e.slice(0,$_(e)+1).replace(ev,``)}function nv(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}var rv=NaN,iv=/^[-+]0x[0-9a-f]+$/i,av=/^0b[01]+$/i,ov=/^0o[0-7]+$/i,sv=parseInt;function cv(e){if(typeof e==`number`)return e;if(Z_(e))return rv;if(nv(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=nv(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=tv(e);var n=av.test(e);return n||ov.test(e)?sv(e.slice(2),n?2:8):iv.test(e)?rv:+e}var lv=function(){return I_.Date.now()},uv=`Expected a function`,dv=Math.max,fv=Math.min;function pv(e,t,n){var r,i,a,o,s,c,l=0,u=!1,d=!1,f=!0;if(typeof e!=`function`)throw TypeError(uv);t=cv(t)||0,nv(n)&&(u=!!n.leading,d=`maxWait`in n,a=d?dv(cv(n.maxWait)||0,t):a,f=`trailing`in n?!!n.trailing:f);function p(t){var n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function m(e){return l=e,s=setTimeout(_,t),u?p(e):o}function h(e){var n=e-c,r=e-l,i=t-n;return d?fv(i,a-r):i}function g(e){var n=e-c,r=e-l;return c===void 0||n>=t||n<0||d&&r>=a}function _(){var e=lv();if(g(e))return v(e);s=setTimeout(_,h(e))}function v(e){return s=void 0,f&&r?p(e):(r=i=void 0,o)}function y(){s!==void 0&&clearTimeout(s),l=0,r=c=i=s=void 0}function b(){return s===void 0?o:v(lv())}function x(){var e=lv(),n=g(e);if(r=arguments,i=this,c=e,n){if(s===void 0)return m(c);if(d)return clearTimeout(s),s=setTimeout(_,t),p(c)}return s===void 0&&(s=setTimeout(_,t)),o}return x.cancel=y,x.flush=b,x}var mv=`Expected a function`;function hv(e,t,n){var r=!0,i=!0;if(typeof e!=`function`)throw TypeError(mv);return nv(n)&&(r=`leading`in n?!!n.leading:r,i=`trailing`in n?!!n.trailing:i),pv(e,t,{leading:r,maxWait:t,trailing:i})}var gv=class{constructor(){this.beforeMountedListeners=[],this.mountedListeners=[],this.updatedListeners=[],this.selectionUpdatedListeners=[],this.markdownUpdatedListeners=[],this.blurListeners=[],this.focusListeners=[],this.destroyListeners=[],this.beforeMount=e=>(this.beforeMountedListeners.push(e),this),this.mounted=e=>(this.mountedListeners.push(e),this),this.updated=e=>(this.updatedListeners.push(e),this)}get listeners(){return{beforeMount:this.beforeMountedListeners,mounted:this.mountedListeners,updated:this.updatedListeners,markdownUpdated:this.markdownUpdatedListeners,blur:this.blurListeners,focus:this.focusListeners,destroy:this.destroyListeners,selectionUpdated:this.selectionUpdatedListeners}}markdownUpdated(e){return this.markdownUpdatedListeners.push(e),this}blur(e){return this.blurListeners.push(e),this}focus(e){return this.focusListeners.push(e),this}destroy(e){return this.destroyListeners.push(e),this}selectionUpdated(e){return this.selectionUpdatedListeners.push(e),this}},_v=_e(new gv,`listener`),vv=new nl(`MILKDOWN_LISTENER`),yv=e=>(e.inject(_v,new gv),async()=>{await e.wait(Mh);let{listeners:t}=e.get(_v);t.beforeMount.forEach(t=>t(e)),await e.wait(ig);let n=e.get(sg),r=null,i=null,a=null,o=null,s=pv(()=>{if(!o)return;let{doc:a}=o;if(t.updated.length>0&&r&&!r.eq(a)&&t.updated.forEach(t=>{t(e,a,r)}),t.markdownUpdated.length>0&&r&&!r.eq(a)){let r=n(a);t.markdownUpdated.forEach(t=>{t(e,r,i)}),i=r}r=a,o=null},200),c=new $c({key:vv,view:()=>({destroy:()=>{t.destroy.forEach(t=>t(e))}}),props:{handleDOMEvents:{focus:()=>(t.focus.forEach(t=>t(e)),!1),blur:()=>(t.blur.forEach(t=>t(e)),!1)}},state:{init:(e,t)=>{r=t.doc,i=n(t.doc)},apply:n=>{let r=n.selection;(!a&&r||a&&!r.eq(a))&&(t.selectionUpdated.forEach(t=>{t(e,r,a)}),a=r),!(!(n.docChanged||n.storedMarksSet)||n.getMeta(`addToHistory`)===!1)&&(o=n,s())}}});e.update(wh,e=>e.concat(c)),await e.wait(bg),t.mounted.forEach(t=>t(e))});yv.meta={package:`@milkdown/plugin-listener`,displayName:`Listener`};function bv(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a);if(!o)return!1;let s=r?n.tr:null;return xv(s,o,e,t)?(r&&r(s.scrollIntoView()),!0):!1}}function xv(e,t,n,r=null){let i=!1,a=t,o=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let e=o.resolve(t.start-2);a=new xo(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new xo(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let s=Ys(a,n,r,t);return s?(e&&Sv(e,t,s,i,n),!0):!1}function Sv(e,t,n,r,i){let a=A.empty;for(let e=n.length-1;e>=0;e--)a=A.from(n[e].type.create(n[e].attrs,a));e.step(new Vs(t.start-(r?2:0),t.end,t.start,t.end,new j(a,0,0),n.length,!0));let o=0;for(let e=0;e<n.length;e++)n[e].type==i&&(o=e+1);let s=n.length-o,c=t.start+n.length-(r?2:0),l=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&ac(e.doc,c,s)&&(e.split(c,s),c+=2*s),c+=l.child(n).nodeSize;return e}function Cv(e,t){return function(n,r){let{$from:i,$to:a,node:o}=n.selection;if(o&&o.isBlock||i.depth<2||!i.sameParent(a))return!1;let s=i.node(-1);if(s.type!=e)return!1;if(i.parent.content.size==0&&i.node(-1).childCount==i.indexAfter(-1)){if(i.depth==3||i.node(-3).type!=e||i.index(-2)!=i.node(-2).childCount-1)return!1;if(r){let t=A.empty,a=i.index(-1)?1:i.index(-2)?2:3;for(let e=i.depth-a;e>=i.depth-3;e--)t=A.from(i.node(e).copy(t));let o=i.indexAfter(-1)<i.node(-2).childCount?1:i.indexAfter(-2)<i.node(-3).childCount?2:3;t=t.append(A.from(e.createAndFill()));let s=i.before(i.depth-(a-1)),c=n.tr.replace(s,i.after(-o),new j(t,4-a,0)),l=-1;c.doc.nodesBetween(s,c.doc.content.size,(e,t)=>{if(l>-1)return!1;e.isTextblock&&e.content.size==0&&(l=t+1)}),l>-1&&c.setSelection(Nc.near(c.doc.resolve(l))),r(c.scrollIntoView())}return!0}let c=a.pos==i.end()?s.contentMatchAt(0).defaultType:null,l=n.tr.delete(i.pos,a.pos),u=c?[t?{type:e,attrs:t}:null,{type:c}]:void 0;return ac(l.doc,i.pos,2,u)?(r&&r(l.split(i.pos,2,u).scrollIntoView()),!0):!1}}function wv(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);return a?n?r.node(a.depth-1).type==e?Tv(t,n,e,a):Ev(t,n,a):!0:!1}}function Tv(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new Vs(a-1,o,a,o,new j(A.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new xo(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let s=qs(r);if(s==null)return!1;i.lift(r,s);let c=i.doc.resolve(i.mapping.map(a,-1)-1);return sc(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function Ev(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,a=n.startIndex;t>a;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let a=r.doc.resolve(n.start),o=a.nodeAfter;if(r.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,c=n.endIndex==i.childCount,l=a.node(-1),u=a.index(-1);if(!l.canReplace(u+ +!s,u+1,o.content.append(c?A.empty:A.from(i))))return!1;let d=a.pos,f=d+o.nodeSize;return r.step(new Vs(d-+!!s,f+ +!!c,d+1,f-1,new j((s?A.empty:A.from(i.copy(A.empty))).append(c?A.empty:A.from(i.copy(A.empty))),+!s,+!c),+!s)),t(r.scrollIntoView()),!0}function Dv(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let s=a.parent,c=s.child(o-1);if(c.type!=e)return!1;if(n){let r=c.lastChild&&c.lastChild.type==s.type,i=A.from(r?e.create():null),o=new j(A.from(e.create(null,A.from(s.type.create(null,i)))),r?3:1,0),l=a.start,u=a.end;n(t.tr.step(new Vs(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}function Ov(e){let t=new Map;if(!e||!e.type)throw Error(`mdast-util-definitions expected node`);return ui(e,`definition`,function(e){let n=kv(e.identifier);n&&!t.get(n)&&t.set(n,e)}),n;function n(e){let n=kv(e);return t.get(n)}}function kv(e){return String(e||``).toUpperCase()}function Av(){return function(e){let t=Ov(e);ui(e,function(e,n,r){if(e.type===`definition`&&r!==void 0&&typeof n==`number`)return r.children.splice(n,1),[si,n];if(e.type===`imageReference`||e.type===`linkReference`){let i=t(e.identifier);if(i&&r&&typeof n==`number`)return r.children[n]=e.type===`imageReference`?{type:`image`,url:i.url,title:i.title,alt:e.alt}:{type:`link`,url:i.url,title:i.title,children:e.children},[si,n]}})}}function jv(e,t){if(!(t.childCount>=1&&t.lastChild?.type.name===`hardbreak`)){e.next(t.content);return}let n=[];t.content.forEach((e,r,i)=>{i!==t.childCount-1&&n.push(e)}),e.next(A.fromArray(n))}function P(e,t){return Object.assign(e,{meta:{package:`@milkdown/preset-commonmark`,...t}}),e}var Mv=Kg(`emphasis`);P(Mv,{displayName:`Attr<emphasis>`,group:`Emphasis`});var Nv=Ug(`emphasis`,e=>({attrs:{marker:{default:e.get(kh).emphasis||`*`,validate:`string`}},parseDOM:[{tag:`i`},{tag:`em`},{style:`font-style`,getAttrs:e=>e===`italic`}],toDOM:t=>[`em`,e.get(Mv.key)(t)],parseMarkdown:{match:e=>e.type===`emphasis`,runner:(e,t,n)=>{e.openMark(n,{marker:t.marker}),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>e.type.name===`emphasis`,runner:(e,t)=>{e.withMark(t,`emphasis`,void 0,{marker:t.attrs.marker})}}}));P(Nv.mark,{displayName:`MarkSchema<emphasis>`,group:`Emphasis`}),P(Nv.ctx,{displayName:`MarkSchemaCtx<emphasis>`,group:`Emphasis`});var Pv=Pg(`ToggleEmphasis`,e=>()=>Ml(Nv.type(e)));P(Pv,{displayName:`Command<toggleEmphasisCommand>`,group:`Emphasis`});var Fv=Fg(e=>ru(/(?:^|[^*])\*([^*]+)\*$/,Nv.type(e),{getAttr:()=>({marker:`*`}),updateCaptured:({fullMatch:e,start:t})=>e.startsWith(`*`)?{}:{fullMatch:e.slice(1),start:t+1}}));P(Fv,{displayName:`InputRule<emphasis>|Star`,group:`Emphasis`});var Iv=Fg(e=>ru(/\b_(?![_\s])(.*?[^_\s])_\b/,Nv.type(e),{getAttr:()=>({marker:`_`}),updateCaptured:({fullMatch:e,start:t})=>e.startsWith(`_`)?{}:{fullMatch:e.slice(1),start:t+1}}));P(Iv,{displayName:`InputRule<emphasis>|Underscore`,group:`Emphasis`});var Lv=Wg(`emphasisKeymap`,{ToggleEmphasis:{shortcuts:`Mod-i`,command:e=>{let t=e.get(Uh);return()=>t.call(Pv.key)}}});P(Lv.ctx,{displayName:`KeymapCtx<emphasis>`,group:`Emphasis`}),P(Lv.shortcuts,{displayName:`Keymap<emphasis>`,group:`Emphasis`});var Rv=Kg(`strong`);P(Rv,{displayName:`Attr<strong>`,group:`Strong`});var zv=Ug(`strong`,e=>({attrs:{marker:{default:e.get(kh).strong||`*`,validate:`string`}},parseDOM:[{tag:`b`,getAttrs:e=>e.style.fontWeight!=`normal`&&null},{tag:`strong`},{style:`font-style`,getAttrs:e=>e===`bold`},{style:`font-weight=400`,clearMark:e=>e.type.name==`strong`},{style:`font-weight`,getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],toDOM:t=>[`strong`,e.get(Rv.key)(t)],parseMarkdown:{match:e=>e.type===`strong`,runner:(e,t,n)=>{e.openMark(n,{marker:t.marker}),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>e.type.name===`strong`,runner:(e,t)=>{e.withMark(t,`strong`,void 0,{marker:t.attrs.marker})}}}));P(zv.mark,{displayName:`MarkSchema<strong>`,group:`Strong`}),P(zv.ctx,{displayName:`MarkSchemaCtx<strong>`,group:`Strong`});var Bv=Pg(`ToggleStrong`,e=>()=>Ml(zv.type(e)));P(Bv,{displayName:`Command<toggleStrongCommand>`,group:`Strong`});var Vv=Fg(e=>ru(/(?<![\w:/])(?:\*\*|__)([^*_]+?)(?:\*\*|__)(?![\w/])$/,zv.type(e),{getAttr:e=>({marker:e[0].startsWith(`*`)?`*`:`_`})}));P(Vv,{displayName:`InputRule<strong>`,group:`Strong`});var Hv=Wg(`strongKeymap`,{ToggleBold:{shortcuts:[`Mod-b`],command:e=>{let t=e.get(Uh);return()=>t.call(Bv.key)}}});P(Hv.ctx,{displayName:`KeymapCtx<strong>`,group:`Strong`}),P(Hv.shortcuts,{displayName:`Keymap<strong>`,group:`Strong`});var Uv=Kg(`inlineCode`);P(Uv,{displayName:`Attr<inlineCode>`,group:`InlineCode`});var Wv=Ug(`inlineCode`,e=>({priority:100,code:!0,parseDOM:[{tag:`code`}],toDOM:t=>[`code`,e.get(Uv.key)(t)],parseMarkdown:{match:e=>e.type===`inlineCode`,runner:(e,t,n)=>{e.openMark(n),e.addText(t.value),e.closeMark(n)}},toMarkdown:{match:e=>e.type.name===`inlineCode`,runner:(e,t,n)=>(e.withMark(t,`inlineCode`,n.text||``),!0)}}));P(Wv.mark,{displayName:`MarkSchema<inlineCode>`,group:`InlineCode`}),P(Wv.ctx,{displayName:`MarkSchemaCtx<inlineCode>`,group:`InlineCode`});var Gv=Pg(`ToggleInlineCode`,e=>()=>(t,n)=>{let{selection:r,tr:i}=t;if(r.empty)return!1;let{from:a,to:o}=r;return t.doc.rangeHasMark(a,o,Wv.type(e))?(n?.(i.removeMark(a,o,Wv.type(e))),!0):(Object.keys(t.schema.marks).filter(e=>e!==Wv.type.name).map(e=>t.schema.marks[e]).forEach(e=>{i.removeMark(a,o,e)}),n?.(i.addMark(a,o,Wv.type(e).create())),!0)});P(Gv,{displayName:`Command<toggleInlineCodeCommand>`,group:`InlineCode`});var Kv=Fg(e=>ru(/(?:`)([^`]+)(?:`)$/,Wv.type(e)));P(Kv,{displayName:`InputRule<inlineCodeInputRule>`,group:`InlineCode`});var qv=Wg(`inlineCodeKeymap`,{ToggleInlineCode:{shortcuts:`Mod-e`,command:e=>{let t=e.get(Uh);return()=>t.call(Gv.key)}}});P(qv.ctx,{displayName:`KeymapCtx<inlineCode>`,group:`InlineCode`}),P(qv.shortcuts,{displayName:`Keymap<inlineCode>`,group:`InlineCode`});var Jv=Kg(`link`);P(Jv,{displayName:`Attr<link>`,group:`Link`});var Yv=Ug(`link`,e=>({attrs:{href:{validate:`string`},title:{default:null,validate:`string|null`}},parseDOM:[{tag:`a[href]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw ue(e);return{href:e.getAttribute(`href`),title:e.getAttribute(`title`)}}}],toDOM:t=>[`a`,{...e.get(Jv.key)(t),...t.attrs}],parseMarkdown:{match:e=>e.type===`link`,runner:(e,t,n)=>{let r=t.url,i=t.title;e.openMark(n,{href:r,title:i}),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>e.type.name===`link`,runner:(e,t)=>{e.withMark(t,`link`,void 0,{title:t.attrs.title,url:t.attrs.href})}}}));P(Yv.mark,{displayName:`MarkSchema<link>`,group:`Link`});var Xv=Pg(`ToggleLink`,e=>(t={})=>Ml(Yv.type(e),t));P(Xv,{displayName:`Command<toggleLinkCommand>`,group:`Link`});var Zv=Pg(`UpdateLink`,e=>(t={})=>(n,r)=>{if(!r)return!1;let i,a=-1,{selection:o}=n,{from:s,to:c}=o;if(n.doc.nodesBetween(s,s===c?c+1:c,(t,n)=>{if(Yv.type(e).isInSet(t.marks))return i=t,a=n,!1}),!i)return!1;let l=i.marks.find(({type:t})=>t===Yv.type(e));if(!l)return!1;let u=a,d=a+i.nodeSize,{tr:f}=n,p=Yv.type(e).create({...l.attrs,...t});return p?(r(f.removeMark(u,d,l).addMark(u,d,p).setSelection(new M(f.selection.$anchor)).scrollIntoView()),!0):!1});P(Zv,{displayName:`Command<updateLinkCommand>`,group:`Link`});var Qv=Rg(`doc`,()=>({content:`block+`,parseMarkdown:{match:({type:e})=>e===`root`,runner:(e,t,n)=>{e.injectRoot(t,n)}},toMarkdown:{match:e=>e.type.name===`doc`,runner:(e,t)=>{e.openNode(`root`),e.next(t.content)}}}));P(Qv,{displayName:`NodeSchema<doc>`,group:`Doc`});function $v(e){return ci(e,e=>e.type===`html`&&[`<br />`,`<br>`,`<br >`,`<br/>`].includes(e.value?.trim()),(e,t)=>{if(!t.length)return;let n=t[t.length-1];if(!n)return;let r=n.children.indexOf(e);r!==-1&&n.children.splice(r,1)},!0)}var ey=qg(`remark-preserve-empty-line`,()=>()=>$v);P(ey.plugin,{displayName:`Remark<remarkPreserveEmptyLine>`,group:`Remark`}),P(ey.options,{displayName:`RemarkConfig<remarkPreserveEmptyLine>`,group:`Remark`});var ty=Gg(`paragraph`);P(ty,{displayName:`Attr<paragraph>`,group:`Paragraph`});var ny=Hg(`paragraph`,e=>({content:`inline*`,group:`block`,parseDOM:[{tag:`p`}],toDOM:t=>[`p`,e.get(ty.key)(t),0],parseMarkdown:{match:e=>e.type===`paragraph`,runner:(e,t,n)=>{e.openNode(n),t.children?e.next(t.children):e.addText(t.value||``),e.closeNode()}},toMarkdown:{match:e=>e.type.name===`paragraph`,runner:(t,n)=>{let r=e.get(yh).state?.doc.lastChild;t.openNode(`paragraph`),(!n.content||n.content.size===0)&&n!==r&&ry(e)?t.addNode(`html`,void 0,`<br />`):jv(t,n),t.closeNode()}}}));function ry(e){let t=!1;try{e.get(ey.id),t=!0}catch{t=!1}return t}P(ny.node,{displayName:`NodeSchema<paragraph>`,group:`Paragraph`}),P(ny.ctx,{displayName:`NodeSchemaCtx<paragraph>`,group:`Paragraph`});var iy=Pg(`TurnIntoText`,e=>()=>kl(ny.type(e)));P(iy,{displayName:`Command<turnIntoTextCommand>`,group:`Paragraph`});var ay=Wg(`paragraphKeymap`,{TurnIntoText:{shortcuts:`Mod-Alt-0`,command:e=>{let t=e.get(Uh);return()=>t.call(iy.key)}}});P(ay.ctx,{displayName:`KeymapCtx<paragraph>`,group:`Paragraph`}),P(ay.shortcuts,{displayName:`Keymap<paragraph>`,group:`Paragraph`});var oy=[,,,,,,].fill(0).map((e,t)=>t+1);function sy(e){return e.textContent.toLowerCase().trim().replace(/\s+/g,`-`)}var cy=Vg(sy,`headingIdGenerator`);P(cy,{displayName:`Ctx<HeadingIdGenerator>`,group:`Heading`});var ly=Gg(`heading`);P(ly,{displayName:`Attr<heading>`,group:`Heading`});var uy=Hg(`heading`,e=>{let t=e.get(cy.key);return{content:`inline*`,group:`block`,defining:!0,attrs:{id:{default:``,validate:`string`},level:{default:1,validate:`number`}},parseDOM:oy.map(e=>({tag:`h${e}`,getAttrs:t=>{if(!(t instanceof HTMLElement))throw ue(t);return{level:e,id:t.id}}})),toDOM:n=>[`h${n.attrs.level}`,{...e.get(ly.key)(n),id:n.attrs.id||t(n)},0],parseMarkdown:{match:({type:e})=>e===`heading`,runner:(e,t,n)=>{let r=t.depth;e.openNode(n,{level:r}),e.next(t.children),e.closeNode()}},toMarkdown:{match:e=>e.type.name===`heading`,runner:(e,t)=>{e.openNode(`heading`,void 0,{depth:t.attrs.level}),jv(e,t),e.closeNode()}}}});P(uy.node,{displayName:`NodeSchema<heading>`,group:`Heading`}),P(uy.ctx,{displayName:`NodeSchemaCtx<heading>`,group:`Heading`});var dy=Fg(e=>Ul(/^(?<hashes>#+)\s$/,uy.type(e),t=>{let n=t.groups?.hashes?.length||0,{$from:r}=e.get(yh).state.selection,i=r.node();if(i.type.name===`heading`){let e=Number(i.attrs.level)+Number(n);return e>6&&(e=6),{level:e}}return{level:n}}));P(dy,{displayName:`InputRule<wrapInHeadingInputRule>`,group:`Heading`});var fy=Pg(`WrapInHeading`,e=>t=>(t??=1,t<1?kl(ny.type(e)):kl(uy.type(e),{level:t})));P(fy,{displayName:`Command<wrapInHeadingCommand>`,group:`Heading`});var py=Pg(`DowngradeHeading`,e=>()=>(t,n,r)=>{let{$from:i}=t.selection,a=i.node();if(a.type!==uy.type(e)||!t.selection.empty||i.parentOffset!==0)return!1;let o=a.attrs.level-1;return o?(n?.(t.tr.setNodeMarkup(t.selection.$from.before(),void 0,{...a.attrs,level:o})),!0):kl(ny.type(e))(t,n,r)});P(py,{displayName:`Command<downgradeHeadingCommand>`,group:`Heading`});var my=Wg(`headingKeymap`,{TurnIntoH1:{shortcuts:`Mod-Alt-1`,command:e=>{let t=e.get(Uh);return()=>t.call(fy.key,1)}},TurnIntoH2:{shortcuts:`Mod-Alt-2`,command:e=>{let t=e.get(Uh);return()=>t.call(fy.key,2)}},TurnIntoH3:{shortcuts:`Mod-Alt-3`,command:e=>{let t=e.get(Uh);return()=>t.call(fy.key,3)}},TurnIntoH4:{shortcuts:`Mod-Alt-4`,command:e=>{let t=e.get(Uh);return()=>t.call(fy.key,4)}},TurnIntoH5:{shortcuts:`Mod-Alt-5`,command:e=>{let t=e.get(Uh);return()=>t.call(fy.key,5)}},TurnIntoH6:{shortcuts:`Mod-Alt-6`,command:e=>{let t=e.get(Uh);return()=>t.call(fy.key,6)}},DowngradeHeading:{shortcuts:[`Delete`,`Backspace`],command:e=>{let t=e.get(Uh);return()=>t.call(py.key)}}});P(my.ctx,{displayName:`KeymapCtx<heading>`,group:`Heading`}),P(my.shortcuts,{displayName:`Keymap<heading>`,group:`Heading`});var hy=Gg(`blockquote`);P(hy,{displayName:`Attr<blockquote>`,group:`Blockquote`});var gy=Hg(`blockquote`,e=>({content:`block+`,group:`block`,defining:!0,parseDOM:[{tag:`blockquote`}],toDOM:t=>[`blockquote`,e.get(hy.key)(t),0],parseMarkdown:{match:({type:e})=>e===`blockquote`,runner:(e,t,n)=>{e.openNode(n).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name===`blockquote`,runner:(e,t)=>{e.openNode(`blockquote`).next(t.content).closeNode()}}}));P(gy.node,{displayName:`NodeSchema<blockquote>`,group:`Blockquote`}),P(gy.ctx,{displayName:`NodeSchemaCtx<blockquote>`,group:`Blockquote`});var _y=Fg(e=>Hl(/^\s*>\s$/,gy.type(e)));P(_y,{displayName:`InputRule<wrapInBlockquoteInputRule>`,group:`Blockquote`});var vy=Pg(`WrapInBlockquote`,e=>()=>Ol(gy.type(e)));P(vy,{displayName:`Command<wrapInBlockquoteCommand>`,group:`Blockquote`});var yy=Wg(`blockquoteKeymap`,{WrapInBlockquote:{shortcuts:`Mod-Shift-b`,command:e=>{let t=e.get(Uh);return()=>t.call(vy.key)}}});P(yy.ctx,{displayName:`KeymapCtx<blockquote>`,group:`Blockquote`}),P(yy.shortcuts,{displayName:`Keymap<blockquote>`,group:`Blockquote`});var by=Gg(`codeBlock`,()=>({pre:{},code:{}}));P(by,{displayName:`Attr<codeBlock>`,group:`CodeBlock`});var xy=Hg(`code_block`,e=>({content:`text*`,group:`block`,marks:``,defining:!0,code:!0,attrs:{language:{default:``,validate:`string`}},parseDOM:[{tag:`pre`,preserveWhitespace:`full`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw ue(e);return{language:e.dataset.language}}}],toDOM:t=>{let n=e.get(by.key)(t),r=t.attrs.language,i=r&&r.length>0?{"data-language":r}:void 0;return[`pre`,{...n.pre,...i},[`code`,n.code,0]]},parseMarkdown:{match:({type:e})=>e===`code`,runner:(e,t,n)=>{let r=t.lang??``,i=t.value;e.openNode(n,{language:r}),i&&e.addText(i),e.closeNode()}},toMarkdown:{match:e=>e.type.name===`code_block`,runner:(e,t)=>{e.addNode(`code`,void 0,t.content.firstChild?.text||``,{lang:t.attrs.language})}}}));P(xy.node,{displayName:`NodeSchema<codeBlock>`,group:`CodeBlock`}),P(xy.ctx,{displayName:`NodeSchemaCtx<codeBlock>`,group:`CodeBlock`});var Sy=Fg(e=>Ul(/^```(?<language>[a-z]*)?[\s\n]$/,xy.type(e),e=>({language:e.groups?.language??``})));P(Sy,{displayName:`InputRule<createCodeBlockInputRule>`,group:`CodeBlock`});var Cy=Pg(`CreateCodeBlock`,e=>(t=``)=>kl(xy.type(e),{language:t}));P(Cy,{displayName:`Command<createCodeBlockCommand>`,group:`CodeBlock`}),P(Pg(`UpdateCodeBlockLanguage`,()=>({pos:e,language:t}={pos:-1,language:``})=>(n,r)=>e>=0?(r?.(n.tr.setNodeAttribute(e,`language`,t)),!0):!1),{displayName:`Command<updateCodeBlockLanguageCommand>`,group:`CodeBlock`});var wy=Wg(`codeBlockKeymap`,{CreateCodeBlock:{shortcuts:`Mod-Alt-c`,command:e=>{let t=e.get(Uh);return()=>t.call(Cy.key)}}});P(wy.ctx,{displayName:`KeymapCtx<codeBlock>`,group:`CodeBlock`}),P(wy.shortcuts,{displayName:`Keymap<codeBlock>`,group:`CodeBlock`});var Ty=Gg(`image`);P(Ty,{displayName:`Attr<image>`,group:`Image`});var Ey=Hg(`image`,e=>({inline:!0,group:`inline`,selectable:!0,draggable:!0,marks:``,atom:!0,defining:!0,isolating:!0,attrs:{src:{default:``,validate:`string`},alt:{default:``,validate:`string`},title:{default:``,validate:`string`}},parseDOM:[{tag:`img[src]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw ue(e);return{src:e.getAttribute(`src`)||``,alt:e.getAttribute(`alt`)||``,title:e.getAttribute(`title`)||e.getAttribute(`alt`)||``}}}],toDOM:t=>[`img`,{...e.get(Ty.key)(t),...t.attrs}],parseMarkdown:{match:({type:e})=>e===`image`,runner:(e,t,n)=>{let r=t.url,i=t.alt,a=t.title;e.addNode(n,{src:r,alt:i,title:a})}},toMarkdown:{match:e=>e.type.name===`image`,runner:(e,t)=>{e.addNode(`image`,void 0,void 0,{title:t.attrs.title,url:t.attrs.src,alt:t.attrs.alt})}}}));P(Ey.node,{displayName:`NodeSchema<image>`,group:`Image`}),P(Ey.ctx,{displayName:`NodeSchemaCtx<image>`,group:`Image`});var Dy=Pg(`InsertImage`,e=>(t={})=>(n,r)=>{if(!r)return!0;let{src:i=``,alt:a=``,title:o=``}=t,s=Ey.type(e).create({src:i,alt:a,title:o});return s&&r(n.tr.replaceSelectionWith(s).scrollIntoView()),!0});P(Dy,{displayName:`Command<insertImageCommand>`,group:`Image`});var Oy=Pg(`UpdateImage`,e=>(t={})=>(n,r)=>{let i=wu(n.selection,Ey.type(e));if(!i)return!1;let{node:a,pos:o}=i,s={...a.attrs},{src:c,alt:l,title:u}=t;return c!==void 0&&(s.src=c),l!==void 0&&(s.alt=l),u!==void 0&&(s.title=u),r?.(n.tr.setNodeMarkup(o,void 0,s).scrollIntoView()),!0});P(Oy,{displayName:`Command<updateImageCommand>`,group:`Image`}),P(Fg(e=>new zl(/!\[(?<alt>.*?)]\((?<filename>.*?)\s*(?="|\))"?(?<title>[^"]+)?"?\)/,(t,n,r,i)=>{let[a,o,s=``,c]=n;return a?t.tr.replaceWith(r,i,Ey.type(e).create({src:s,alt:o,title:c})):null})),{displayName:`InputRule<insertImageInputRule>`,group:`Image`});var ky=Gg(`hardbreak`,e=>({"data-type":`hardbreak`,"data-is-inline":e.attrs.isInline}));P(ky,{displayName:`Attr<hardbreak>`,group:`Hardbreak`});var Ay=Hg(`hardbreak`,e=>({inline:!0,group:`inline`,attrs:{isInline:{default:!1,validate:`boolean`}},selectable:!1,parseDOM:[{tag:`br`},{tag:`span[data-type="hardbreak"]`,getAttrs:()=>({isInline:!0})}],toDOM:t=>t.attrs.isInline?[`span`,e.get(ky.key)(t),` `]:[`br`,e.get(ky.key)(t)],parseMarkdown:{match:({type:e})=>e===`break`,runner:(e,t,n)=>{e.addNode(n,{isInline:!!t.data?.isInline})}},leafText:()=>`
|
|
48
|
+
`,toMarkdown:{match:e=>e.type.name===`hardbreak`,runner:(e,t)=>{t.attrs.isInline?e.addNode(`text`,void 0,`
|
|
49
|
+
`):e.addNode(`break`)}}}));P(Ay.node,{displayName:`NodeSchema<hardbreak>`,group:`Hardbreak`}),P(Ay.ctx,{displayName:`NodeSchemaCtx<hardbreak>`,group:`Hardbreak`});var jy=Pg(`InsertHardbreak`,e=>()=>(t,n)=>{let{selection:r,tr:i}=t;if(!(r instanceof M))return!1;if(r.empty){let e=r.$from.node();if(e.childCount>0&&e.lastChild?.type.name===`hardbreak`)return n?.(i.replaceRangeWith(r.to-1,r.to,t.schema.node(`paragraph`)).setSelection(Nc.near(i.doc.resolve(r.to))).scrollIntoView()),!0}return n?.(i.setMeta(`hardbreak`,!0).replaceSelectionWith(Ay.type(e).create()).scrollIntoView()),!0});P(jy,{displayName:`Command<insertHardbreakCommand>`,group:`Hardbreak`});var My=Wg(`hardbreakKeymap`,{InsertHardbreak:{shortcuts:`Shift-Enter`,command:e=>{let t=e.get(Uh);return()=>t.call(jy.key)}}});P(My.ctx,{displayName:`KeymapCtx<hardbreak>`,group:`Hardbreak`}),P(My.shortcuts,{displayName:`Keymap<hardbreak>`,group:`Hardbreak`});var Ny=Gg(`hr`);P(Ny,{displayName:`Attr<hr>`,group:`Hr`});var Py=Hg(`hr`,e=>({group:`block`,parseDOM:[{tag:`hr`}],toDOM:t=>[`hr`,e.get(Ny.key)(t)],parseMarkdown:{match:({type:e})=>e===`thematicBreak`,runner:(e,t,n)=>{e.addNode(n)}},toMarkdown:{match:e=>e.type.name===`hr`,runner:e=>{e.addNode(`thematicBreak`)}}}));P(Py.node,{displayName:`NodeSchema<hr>`,group:`Hr`}),P(Py.ctx,{displayName:`NodeSchemaCtx<hr>`,group:`Hr`});var Fy=Fg(e=>new zl(/^(?:---|___\s|\*\*\*\s)$/,(t,n,r,i)=>{let{tr:a}=t;return n[0]&&a.replaceWith(r-1,i,Py.type(e).create()),a}));P(Fy,{displayName:`InputRule<insertHrInputRule>`,group:`Hr`});var Iy=Pg(`InsertHr`,e=>()=>(t,n)=>{if(!n)return!0;let r=ny.node.type(e).create(),{tr:i,selection:a}=t,{from:o}=a,s=Py.type(e).create();if(!s)return!0;let c=i.replaceSelectionWith(s).insert(o,r),l=Nc.findFrom(c.doc.resolve(o),1,!0);return l&&n(c.setSelection(l).scrollIntoView()),!0});P(Iy,{displayName:`Command<insertHrCommand>`,group:`Hr`});var Ly=Gg(`bulletList`);P(Ly,{displayName:`Attr<bulletList>`,group:`BulletList`});var Ry=Hg(`bullet_list`,e=>({content:`listItem+`,group:`block`,attrs:{spread:{default:!1,validate:`boolean`}},parseDOM:[{tag:`ul`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw ue(e);return{spread:e.dataset.spread===`true`}}}],toDOM:t=>[`ul`,{...e.get(Ly.key)(t),"data-spread":t.attrs.spread},0],parseMarkdown:{match:({type:e,ordered:t})=>e===`list`&&!t,runner:(e,t,n)=>{let r=t.spread==null?`false`:`${t.spread}`;e.openNode(n,{spread:r}).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name===`bullet_list`,runner:(e,t)=>{e.openNode(`list`,void 0,{ordered:!1,spread:t.attrs.spread}).next(t.content).closeNode()}}}));P(Ry.node,{displayName:`NodeSchema<bulletList>`,group:`BulletList`}),P(Ry.ctx,{displayName:`NodeSchemaCtx<bulletList>`,group:`BulletList`});var zy=Fg(e=>Hl(/^\s*([-+*])\s$/,Ry.type(e)));P(zy,{displayName:`InputRule<wrapInBulletListInputRule>`,group:`BulletList`});var By=Pg(`WrapInBulletList`,e=>()=>Ol(Ry.type(e)));P(By,{displayName:`Command<wrapInBulletListCommand>`,group:`BulletList`});var Vy=Wg(`bulletListKeymap`,{WrapInBulletList:{shortcuts:`Mod-Alt-8`,command:e=>{let t=e.get(Uh);return()=>t.call(By.key)}}});P(Vy.ctx,{displayName:`KeymapCtx<bulletListKeymap>`,group:`BulletList`}),P(Vy.shortcuts,{displayName:`Keymap<bulletListKeymap>`,group:`BulletList`});var Hy=Gg(`orderedList`);P(Hy,{displayName:`Attr<orderedList>`,group:`OrderedList`});var Uy=Hg(`ordered_list`,e=>({content:`listItem+`,group:`block`,attrs:{order:{default:1,validate:`number`},spread:{default:!1,validate:`boolean`}},parseDOM:[{tag:`ol`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw ue(e);return{spread:e.dataset.spread,order:e.hasAttribute(`start`)?Number(e.getAttribute(`start`)):1}}}],toDOM:t=>[`ol`,{...e.get(Hy.key)(t),...t.attrs.order===1?{}:{start:t.attrs.order},"data-spread":t.attrs.spread},0],parseMarkdown:{match:({type:e,ordered:t})=>e===`list`&&!!t,runner:(e,t,n)=>{let r=t.spread==null?`true`:`${t.spread}`;e.openNode(n,{spread:r,order:t.start??1}).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name===`ordered_list`,runner:(e,t)=>{e.openNode(`list`,void 0,{ordered:!0,start:t.attrs.order??1,spread:t.attrs.spread===`true`}),e.next(t.content),e.closeNode()}}}));P(Uy.node,{displayName:`NodeSchema<orderedList>`,group:`OrderedList`}),P(Uy.ctx,{displayName:`NodeSchemaCtx<orderedList>`,group:`OrderedList`});var Wy=Fg(e=>Hl(/^\s*(\d+)\.\s$/,Uy.type(e),e=>({order:Number(e[1])}),(e,t)=>t.childCount+t.attrs.order===Number(e[1])));P(Wy,{displayName:`InputRule<wrapInOrderedListInputRule>`,group:`OrderedList`});var Gy=Pg(`WrapInOrderedList`,e=>()=>Ol(Uy.type(e)));P(Gy,{displayName:`Command<wrapInOrderedListCommand>`,group:`OrderedList`});var Ky=Wg(`orderedListKeymap`,{WrapInOrderedList:{shortcuts:`Mod-Alt-7`,command:e=>{let t=e.get(Uh);return()=>t.call(Gy.key)}}});P(Ky.ctx,{displayName:`KeymapCtx<orderedList>`,group:`OrderedList`}),P(Ky.shortcuts,{displayName:`Keymap<orderedList>`,group:`OrderedList`});var qy=Gg(`listItem`);P(qy,{displayName:`Attr<listItem>`,group:`ListItem`});var Jy=Hg(`list_item`,e=>({group:`listItem`,content:`paragraph block*`,attrs:{label:{default:`•`,validate:`string`},listType:{default:`bullet`,validate:`string`},spread:{default:!0,validate:`boolean`}},defining:!0,parseDOM:[{tag:`li`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw ue(e);return{label:e.dataset.label,listType:e.dataset.listType,spread:e.dataset.spread===`true`}}}],toDOM:t=>[`li`,{...e.get(qy.key)(t),"data-label":t.attrs.label,"data-list-type":t.attrs.listType,"data-spread":t.attrs.spread},0],parseMarkdown:{match:({type:e})=>e===`listItem`,runner:(e,t,n)=>{let r=t.label==null?`•`:`${t.label}.`,i=t.label==null?`bullet`:`ordered`,a=t.spread==null?`true`:`${t.spread}`;e.openNode(n,{label:r,listType:i,spread:a}),e.next(t.children),e.closeNode()}},toMarkdown:{match:e=>e.type.name===`list_item`,runner:(e,t)=>{e.openNode(`listItem`,void 0,{spread:t.attrs.spread}),e.next(t.content),e.closeNode()}}}));P(Jy.node,{displayName:`NodeSchema<listItem>`,group:`ListItem`}),P(Jy.ctx,{displayName:`NodeSchemaCtx<listItem>`,group:`ListItem`});var Yy=Pg(`SinkListItem`,e=>()=>Dv(Jy.type(e)));P(Yy,{displayName:`Command<sinkListItemCommand>`,group:`ListItem`});var Xy=Pg(`LiftListItem`,e=>()=>wv(Jy.type(e)));P(Xy,{displayName:`Command<liftListItemCommand>`,group:`ListItem`});var Zy=Pg(`SplitListItem`,e=>()=>Cv(Jy.type(e)));P(Zy,{displayName:`Command<splitListItemCommand>`,group:`ListItem`});function Qy(e){return(t,n,r)=>{let{selection:i}=t;if(!(i instanceof M))return!1;let{empty:a,$from:o}=i;return!a||o.parentOffset!==0||o.node(-1).type!==Jy.type(e)?!1:al(t,n,r)}}var $y=Pg(`LiftFirstListItem`,e=>()=>Qy(e));P($y,{displayName:`Command<liftFirstListItemCommand>`,group:`ListItem`});var eb=Wg(`listItemKeymap`,{NextListItem:{shortcuts:`Enter`,command:e=>{let t=e.get(Uh);return()=>t.call(Zy.key)}},SinkListItem:{shortcuts:[`Tab`,`Mod-]`],command:e=>{let t=e.get(Uh);return()=>t.call(Yy.key)}},LiftListItem:{shortcuts:[`Shift-Tab`,`Mod-[`],command:e=>{let t=e.get(Uh);return()=>t.call(Xy.key)}},LiftFirstListItem:{shortcuts:[`Backspace`,`Delete`],command:e=>{let t=e.get(Uh);return()=>t.call($y.key)}}});P(eb.ctx,{displayName:`KeymapCtx<listItem>`,group:`ListItem`}),P(eb.shortcuts,{displayName:`Keymap<listItem>`,group:`ListItem`});var tb=Rg(`text`,()=>({group:`inline`,parseMarkdown:{match:({type:e})=>e===`text`,runner:(e,t)=>{e.addText(t.value)}},toMarkdown:{match:e=>e.type.name===`text`,runner:(e,t)=>{e.addNode(`text`,void 0,t.text)}}}));P(tb,{displayName:`NodeSchema<text>`,group:`Text`});var nb=Gg(`html`);P(nb,{displayName:`Attr<html>`,group:`Html`});var rb=Hg(`html`,e=>({atom:!0,group:`inline`,inline:!0,attrs:{value:{default:``,validate:`string`}},toDOM:t=>{let n=document.createElement(`span`),r={...e.get(nb.key)(t),"data-value":t.attrs.value,"data-type":`html`};return n.textContent=t.attrs.value,[`span`,r,t.attrs.value]},parseDOM:[{tag:`span[data-type="html"]`,getAttrs:e=>({value:e.dataset.value??``})}],parseMarkdown:{match:({type:e})=>e===`html`,runner:(e,t,n)=>{e.addNode(n,{value:t.value})}},toMarkdown:{match:e=>e.type.name===`html`,runner:(e,t)=>{e.addNode(`html`,void 0,t.attrs.value)}}}));P(rb.node,{displayName:`NodeSchema<html>`,group:`Html`}),P(rb.ctx,{displayName:`NodeSchemaCtx<html>`,group:`Html`});var ib=[Qv,ty,ny,cy,ly,uy,ky,Ay,hy,gy,by,xy,Ny,Py,Ty,Ey,Ly,Ry,Hy,Uy,qy,Jy,Mv,Nv,Rv,zv,Uv,Wv,Jv,Yv,nb,rb,tb].flat(),ab=[_y,zy,Wy,Sy,Fy,dy].flat(),ob=[Fv,Iv,Kv,Vv],sb=[iy,vy,fy,py,Cy,jy,Iy,Dy,Oy,Gy,By,Yy,Zy,Xy,$y,Pv,Gv,Bv,Xv,Zv,Pg(`IsMarkSelected`,()=>e=>t=>{if(!e)return!1;let{doc:n,selection:r}=t;return n.rangeHasMark(r.from,r.to,e)}),Pg(`IsNoteSelected`,()=>e=>t=>e?Tu(t,e).hasNode:!1),Pg(`ClearTextInCurrentBlock`,()=>()=>(e,t)=>{let n=e.tr,{$from:r,$to:i}=n.selection,{pos:a}=r,{pos:o}=i,s=a-r.node().content.size;return s<0?!1:(n=n.deleteRange(s,o),t?.(n),!0)}),Pg(`SetBlockType`,()=>e=>(t,n)=>{let{nodeType:r,attrs:i=null}=e??{};if(!r)return!1;let a=t.tr,{from:o,to:s}=a.selection;try{a.setBlockType(o,s,r,i)}catch{return!1}return n?.(a),!0}),Pg(`WrapInBlockType`,()=>e=>(t,n)=>{let{nodeType:r,attrs:i=null}=e??{};if(!r)return!1;let a=t.tr;try{let{$from:e,$to:t}=a.selection,n=e.blockRange(t),o=n&&Ys(n,r,i);if(!o)return!1;a=a.wrap(n,o)}catch{return!1}return n?.(a),!0}),Pg(`AddBlockType`,()=>e=>(t,n)=>{let{nodeType:r,attrs:i=null}=e??{};if(!r)return!1;let a=t.tr;try{let e=r instanceof Co?r:r.createAndFill(i);if(!e)return!1;a.replaceSelectionWith(e)}catch{return!1}return n?.(a),!0}),Pg(`SelectTextNearPos`,()=>e=>(t,n)=>{let{pos:r}=e??{};if(r==null)return!1;let i=(e,t,n)=>Math.min(Math.max(e,t),n),a=t.tr;try{let e=t.doc.resolve(i(r,0,t.doc.content.size));a.setSelection(M.near(e))}catch{return!1}return n?.(a.scrollIntoView()),!0})],cb=[yy,wy,My,my,eb,Ky,Vy,ay,Lv,qv,Hv].flat(),lb=qg(`remarkAddOrderInList`,()=>()=>e=>{ui(e,`list`,e=>{if(e.ordered){let t=e.start??1;e.children.forEach((e,n)=>{e.label=n+t})}})});P(lb.plugin,{displayName:`Remark<remarkAddOrderInListPlugin>`,group:`Remark`}),P(lb.options,{displayName:`RemarkConfig<remarkAddOrderInListPlugin>`,group:`Remark`});var ub=qg(`remarkLineBreak`,()=>()=>e=>{let t=/[\t ]*(?:\r?\n|\r)/g;ui(e,`text`,(e,n,r)=>{if(!e.value||typeof e.value!=`string`)return;let i=[],a=0;t.lastIndex=0;let o=t.exec(e.value);for(;o;){let n=o.index;a!==n&&i.push({type:`text`,value:e.value.slice(a,n)}),i.push({type:`break`,data:{isInline:!0}}),a=n+o[0].length,o=t.exec(e.value)}if(i.length>0&&r&&typeof n==`number`)return a<e.value.length&&i.push({type:`text`,value:e.value.slice(a)}),r.children.splice(n,1,...i),n+i.length})});P(ub.plugin,{displayName:`Remark<remarkLineBreak>`,group:`Remark`}),P(ub.options,{displayName:`RemarkConfig<remarkLineBreak>`,group:`Remark`});var db=qg(`remarkInlineLink`,()=>Av);P(db.plugin,{displayName:`Remark<remarkInlineLinkPlugin>`,group:`Remark`}),P(db.options,{displayName:`RemarkConfig<remarkInlineLinkPlugin>`,group:`Remark`});var fb=e=>!!e.children,pb=e=>e.type===`html`;function mb(e,t){return n(e,0,null)[0];function n(e,r,i){if(fb(e)){let t=[];for(let r=0,i=e.children.length;r<i;r++){let i=e.children[r];if(i){let a=n(i,r,e);if(a)for(let e=0,n=a.length;e<n;e++){let n=a[e];n&&t.push(n)}}}e.children=t}return t(e,r,i)}}var hb=[`root`,`blockquote`,`listItem`],gb=qg(`remarkHTMLTransformer`,()=>()=>e=>{mb(e,(e,t,n)=>(pb(e)&&n&&hb.includes(n.type)&&(e.children=[{...e}],delete e.value,e.type=`paragraph`),[e]))});P(gb.plugin,{displayName:`Remark<remarkHtmlTransformer>`,group:`Remark`}),P(gb.options,{displayName:`RemarkConfig<remarkHtmlTransformer>`,group:`Remark`});var _b=qg(`remarkMarker`,()=>()=>(e,t)=>{let n=e=>t.value.charAt(e.position.start.offset);ui(e,e=>[`strong`,`emphasis`].includes(e.type),e=>{e.marker=n(e)})});P(_b.plugin,{displayName:`Remark<remarkMarker>`,group:`Remark`}),P(_b.options,{displayName:`RemarkConfig<remarkMarker>`,group:`Remark`});var vb=zg(()=>{let e=!1,t=new $c({key:new nl(`MILKDOWN_INLINE_NODES_CURSOR`),state:{init(){return!1},apply(e){if(!e.selection.empty)return!1;let t=e.selection.$from,n=t.nodeBefore,r=t.nodeAfter;return!!(n&&r&&n.isInline&&!n.isText&&r.isInline&&!r.isText)}},props:{handleDOMEvents:{compositionend:(n,r)=>e?(e=!1,requestAnimationFrame(()=>{if(t.getState(n.state)){let e=n.state.selection.from;r.preventDefault(),n.dispatch(n.state.tr.insertText(r.data||``,e))}}),!0):!1,compositionstart:n=>(t.getState(n.state)&&(e=!0),!1),beforeinput:(n,r)=>{if(t.getState(n.state)&&r instanceof InputEvent&&r.data&&!e){let e=n.state.selection.from;return r.preventDefault(),n.dispatch(n.state.tr.insertText(r.data||``,e)),!0}return!1}},decorations(e){if(t.getState(e)){let t=e.selection.$from.pos,n=document.createElement(`span`),r=Em.widget(t,n,{side:-1}),i=document.createElement(`span`),a=Em.widget(t,i);return setTimeout(()=>{n.contentEditable=`true`,i.contentEditable=`true`}),km.create(e.doc,[r,a])}return km.empty}}});return t});P(vb,{displayName:`Prose<inlineNodesCursorPlugin>`,group:`Prose`});var yb=zg(e=>new $c({key:new nl(`MILKDOWN_HARDBREAK_MARKS`),appendTransaction:(t,n,r)=>{if(!t.length)return;let[i]=t;if(!i)return;let[a]=i.steps;if(i.getMeta(`hardbreak`)){if(!(a instanceof Bs))return;let{from:t}=a;return r.tr.setNodeMarkup(t,Ay.type(e),void 0,[])}if(a instanceof Is){let t=r.tr,{from:n,to:i}=a;return r.doc.nodesBetween(n,i,(n,r)=>{n.type===Ay.type(e)&&(t=t.setNodeMarkup(r,Ay.type(e),void 0,[]))}),t}}}));P(yb,{displayName:`Prose<hardbreakClearMarkPlugin>`,group:`Prose`});var bb=Vg([`table`,`code_block`],`hardbreakFilterNodes`);P(bb,{displayName:`Ctx<hardbreakFilterNodes>`,group:`Prose`});var xb=zg(e=>{let t=e.get(bb.key);return new $c({key:new nl(`MILKDOWN_HARDBREAK_FILTER`),filterTransaction:(e,n)=>{let r=e.getMeta(`hardbreak`),[i]=e.steps;if(r&&i){let{from:e}=i,r=n.doc.resolve(e),a=r.depth,o=!0;for(;a>0;)t.includes(r.node(a).type.name)&&(o=!1),a--;return o}return!0}})});P(xb,{displayName:`Prose<hardbreakFilterPlugin>`,group:`Prose`});var Sb=zg(e=>{let t=new nl(`MILKDOWN_HEADING_ID`),n=n=>{if(n.composing)return;let r=e.get(cy.key),i=n.state.tr.setMeta(`addToHistory`,!1),a=!1,o={};n.state.doc.descendants((n,s)=>{if(n.type===uy.type(e)){if(n.textContent.trim().length===0)return;let e=n.attrs,c=r(n);o[c]?(o[c]+=1,c+=`-#${o[c]}`):o[c]=1,e.id!==c&&(a=!0,i.setMeta(t,!0).setNodeMarkup(s,void 0,{...e,id:c}))}}),a&&n.dispatch(i)};return new $c({key:t,view:e=>(n(e),{update:(e,t)=>{e.state.doc.eq(t.doc)||n(e)}})})});P(Sb,{displayName:`Prose<syncHeadingIdPlugin>`,group:`Prose`});var Cb=zg(e=>new $c({key:new nl(`MILKDOWN_KEEP_LIST_ORDER`),appendTransaction:(t,n,r)=>{if(!r.selection||t.some(e=>e.getMeta(`addToHistory`)===!1||!e.isGeneric))return null;let i=Uy.type(e),a=Ry.type(e),o=Jy.type(e),s=(e,t,n=1)=>{let r=!1,i=`${t+n}.`;return e.label!==i&&(e.label=i,r=!0),r},c=r.tr,l=!1;return r.doc.descendants((e,t,n,r)=>{if(e.type===a){let n=e.maybeChild(0);n?.type===o&&n.attrs.listType===`ordered`&&(l=!0,c.setNodeMarkup(t,i,{spread:`true`}),e.descendants((e,t,n,r)=>{if(e.type===o){let n={...e.attrs};s(n,r)&&(c=c.setNodeMarkup(t,void 0,n))}return!1}))}else if(e.type===o&&n?.type===i){let i={...e.attrs},a=!1;i.listType!==`ordered`&&(i.listType=`ordered`,a=!0),n?.maybeChild(0)&&(a=s(i,r,n?.attrs.order??1)),a&&(c=c.setNodeMarkup(t,void 0,i),l=!0)}}),l?c.setMeta(`addToHistory`,!1):null}}));P(Cb,{displayName:`Prose<syncListOrderPlugin>`,group:`Prose`});var wb=[ib,ab,ob,sb,cb,[yb,bb,xb,vb,lb,db,ub,gb,_b,ey,Sb,Cb].flat()].flat(),Tb,Eb;if(typeof WeakMap<`u`){let e=new WeakMap;Tb=t=>e.get(t),Eb=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;Tb=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},Eb=(n,r)=>(t==10&&(t=0),e[t++]=n,e[t++]=r)}var Db=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,i=t/this.width|0,a=r+1,o=i+1;for(let e=1;a<this.width&&this.map[t+e]==n;e++)a++;for(let e=1;o<this.height&&this.map[t+this.width*e]==n;e++)o++;return{left:r,top:i,right:a,bottom:o}}throw RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:r,right:i,top:a,bottom:o}=this.findCell(e);return t==`horiz`?(n<0?r==0:i==this.width)?null:this.map[a*this.width+(n<0?r-1:i)]:(n<0?a==0:o==this.height)?null:this.map[r+this.width*(n<0?a-1:o)]}rectBetween(e,t){let{left:n,right:r,top:i,bottom:a}=this.findCell(e),{left:o,right:s,top:c,bottom:l}=this.findCell(t);return{left:Math.min(n,o),top:Math.min(i,c),right:Math.max(r,s),bottom:Math.max(a,l)}}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){let a=r*this.width+i,o=this.map[a];n[o]||(n[o]=!0,!(i==e.left&&i&&this.map[a-1]==o||r==e.top&&r&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){let a=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?a-1:this.map[n]}i=a}}static get(e){return Tb(e)||Eb(e,Ob(e))}};function Ob(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=kb(e),n=e.childCount,r=[],i=0,a=null,o=[];for(let e=0,i=t*n;e<i;e++)r[e]=0;for(let s=0,c=0;s<n;s++){let l=e.child(s);c++;for(let e=0;;e++){for(;i<r.length&&r[i]!=0;)i++;if(e==l.childCount)break;let u=l.child(e),{colspan:d,rowspan:f,colwidth:p}=u.attrs;for(let e=0;e<f;e++){if(e+s>=n){(a||=[]).push({type:`overlong_rowspan`,pos:c,n:f-e});break}let l=i+e*t;for(let e=0;e<d;e++){r[l+e]==0?r[l+e]=c:(a||=[]).push({type:`collision`,row:s,pos:c,n:d-e});let n=p&&p[e];if(n){let r=(l+e)%t*2,i=o[r];i==null||i!=n&&o[r+1]==1?(o[r]=n,o[r+1]=1):i==n&&o[r+1]++}}}i+=d,c+=u.nodeSize}let u=(s+1)*t,d=0;for(;i<u;)r[i++]==0&&d++;d&&(a||=[]).push({type:`missing`,row:s,n:d}),c++}(t===0||n===0)&&(a||=[]).push({type:`zero_sized`});let s=new Db(t,n,r,a),c=!1;for(let e=0;!c&&e<o.length;e+=2)o[e]!=null&&o[e+1]<n&&(c=!0);return c&&Ab(s,o,e),s}function kb(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let i=e.child(r),a=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let i=n.child(e);t+i.attrs.rowspan>r&&(a+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){let t=i.child(e);a+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function Ab(e,t,n){e.problems||=[];let r={};for(let i=0;i<e.map.length;i++){let a=e.map[i];if(r[a])continue;r[a]=!0;let o=n.nodeAt(a);if(!o)throw RangeError(`No cell with offset ${a} found`);let s=null,c=o.attrs;for(let n=0;n<c.colspan;n++){let r=t[(i+n)%e.width*2];r!=null&&(!c.colwidth||c.colwidth[n]!=r)&&((s||=jb(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function jb(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function Mb(e,t){if(typeof e==`string`)return{};let n=e.getAttribute(`data-colwidth`),r=n&&/^\d+(,\d+)*$/.test(n)?n.split(`,`).map(e=>Number(e)):null,i=Number(e.getAttribute(`colspan`)||1),a={colspan:i,rowspan:Number(e.getAttribute(`rowspan`)||1),colwidth:r&&r.length==i?r:null};for(let n in t){let r=t[n].getFromDOM,i=r&&r(e);i!=null&&(a[n]=i)}return a}function Nb(e,t){let n={};e.attrs.colspan!=1&&(n.colspan=e.attrs.colspan),e.attrs.rowspan!=1&&(n.rowspan=e.attrs.rowspan),e.attrs.colwidth&&(n[`data-colwidth`]=e.attrs.colwidth.join(`,`));for(let r in t){let i=t[r].setDOMAttr;i&&i(e.attrs[r],n)}return n}function Pb(e){if(e!==null){if(!Array.isArray(e))throw TypeError(`colwidth must be null or an array`);for(let t of e)if(typeof t!=`number`)throw TypeError(`colwidth must be null or an array of numbers`)}}function Fb(e){let t=e.cellAttributes||{},n={colspan:{default:1,validate:`number`},rowspan:{default:1,validate:`number`},colwidth:{default:null,validate:Pb}};for(let e in t)n[e]={default:t[e].default,validate:t[e].validate};return{table:{content:`table_row+`,tableRole:`table`,isolating:!0,group:e.tableGroup,parseDOM:[{tag:`table`}],toDOM(){return[`table`,[`tbody`,0]]}},table_row:{content:`(table_cell | table_header)*`,tableRole:`row`,parseDOM:[{tag:`tr`}],toDOM(){return[`tr`,0]}},table_cell:{content:e.cellContent,attrs:n,tableRole:`cell`,isolating:!0,parseDOM:[{tag:`td`,getAttrs:e=>Mb(e,t)}],toDOM(e){return[`td`,Nb(e,t),0]}},table_header:{content:e.cellContent,attrs:n,tableRole:`header_cell`,isolating:!0,parseDOM:[{tag:`th`,getAttrs:e=>Mb(e,t)}],toDOM(e){return[`th`,Nb(e,t),0]}}}}function Ib(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}var Lb=new nl(`selectingCells`);function Rb(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole==`row`)return e.node(0).resolve(e.before(t+1));return null}function zb(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if(t.node(e).type.spec.tableRole==`row`)return!0;return!1}function Bb(e){let t=e.selection;if(`$anchorCell`in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if(`node`in t&&t.node&&t.node.type.spec.tableRole==`cell`)return t.$anchor;let n=Rb(t.$head)||Vb(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function Vb(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n-t.nodeSize)}}function Hb(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function Ub(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function Wb(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function Gb(e,t,n){let r=e.node(-1),i=Db.get(r),a=e.start(-1),o=i.nextCell(e.pos-a,t,n);return o==null?null:e.node(0).resolve(a+o)}function Kb(e,t,n=1){let r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}function qb(e,t,n=1){let r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}function Jb(e,t,n){let r=Ib(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0}var Yb=class e extends Nc{constructor(e,t=e){let n=e.node(-1),r=Db.get(n),i=e.start(-1),a=r.rectBetween(e.pos-i,t.pos-i),o=e.node(0),s=r.cellsInRect(a).filter(e=>e!=t.pos-i);s.unshift(t.pos-i);let c=s.map(e=>{let t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let r=i+e+1;return new Pc(o.resolve(r),o.resolve(r+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(t,n){let r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(Hb(r)&&Hb(i)&&Wb(r,i)){let t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,i):t&&this.isColSelection()?e.colSelection(r,i):new e(r,i)}return M.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=Db.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},a=[];for(let n=r.top;n<r.bottom;n++){let o=[];for(let a=n*t.width+r.left,s=r.left;s<r.right;s++,a++){let n=t.map[a];if(i[n])continue;i[n]=!0;let s=t.findCell(n),c=e.nodeAt(n);if(!c)throw RangeError(`No cell with offset ${n} found`);let l=r.left-s.left,u=s.right-r.right;if(l>0||u>0){let e=c.attrs;if(l>0&&(e=Kb(e,0,l)),u>0&&(e=Kb(e,e.colspan-u,u)),s.left<r.left){if(c=c.type.createAndFill(e),!c)throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else c=c.type.create(e,c.content)}if(s.top<r.top||s.bottom>r.bottom){let e={...c.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};c=s.top<r.top?c.type.createAndFill(e):c.type.create(e,c.content)}o.push(c)}a.push(e.child(n).copy(A.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new j(A.from(o),1,1)}replace(e,t=j.empty){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n);e.replace(s.map(a.pos),s.map(o.pos),i?j.empty:t)}let i=Nc.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new j(A.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=Db.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)e(t.nodeAt(i[n]),r+i[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let r=t.node(-1),i=Db.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.top<=s.top?(o.top>0&&(t=c.resolve(a+i.map[o.left])),s.bottom<i.height&&(n=c.resolve(a+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=c.resolve(a+i.map[s.left])),o.bottom<i.height&&(t=c.resolve(a+i.map[i.width*(i.height-1)+o.right-1]))),new e(t,n)}isRowSelection(){let e=this.$anchorCell.node(-1),t=Db.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),i=t.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)return!1;let a=r+this.$anchorCell.nodeAfter.attrs.colspan,o=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,o)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let r=t.node(-1),i=Db.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.left<=s.left?(o.left>0&&(t=c.resolve(a+i.map[o.top*i.width])),s.right<i.width&&(n=c.resolve(a+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=c.resolve(a+i.map[s.top*i.width])),o.right<i.width&&(t=c.resolve(a+i.map[i.width*(o.top+1)-1]))),new e(t,n)}toJSON(){return{type:`cell`,anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new Xb(this.$anchorCell.pos,this.$headCell.pos)}};Yb.prototype.visible=!1,Nc.jsonID(`cell`,Yb);var Xb=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole==`row`&&n.parent.type.spec.tableRole==`row`&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&Wb(t,n)?new Yb(t,n):Nc.near(n,1)}};function Zb(e){if(!(e.selection instanceof Yb))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(Em.node(n,n+e.nodeSize,{class:`selectedCell`}))}),km.create(e.doc,t)}function Qb({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function $b({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if(r.type.spec.tableRole===`cell`||r.type.spec.tableRole===`header_cell`){n=r;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if(n.type.spec.tableRole===`cell`||n.type.spec.tableRole===`header_cell`){r=n;break}}return n!==r&&t.parentOffset===0}function ex(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof N&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=Yb.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=Yb.rowSelection(e,e)}else if(!n){let e=Db.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=Yb.create(i,t+1,n)}}else r instanceof M&&Qb(r)?a=M.create(i,r.from):r instanceof M&&$b(r)&&(a=M.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}var tx=new nl(`fix-tables`);function nx(e,t,n,r){let i=e.childCount,a=t.childCount;outer:for(let o=0,s=0;o<a;o++){let a=t.child(o);for(let t=s,r=Math.min(i,o+3);t<r;t++)if(e.child(t)==a){s=t+1,n+=a.nodeSize;continue outer}r(a,n),s<i&&e.child(s).sameMarkup(a)?nx(e.child(s),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function rx(e,t){let n,r=(t,r)=>{t.type.spec.tableRole==`table`&&(n=ix(e,t,r,n))};return t?t.doc!=e.doc&&nx(t.doc,e.doc,0,r):e.doc.descendants(r),n}function ix(e,t,n,r){let i=Db.get(t);if(!i.problems)return r;r||=e.tr;let a=[];for(let e=0;e<i.height;e++)a.push(0);for(let e=0;e<i.problems.length;e++){let o=i.problems[e];if(o.type==`collision`){let e=t.nodeAt(o.pos);if(!e)continue;let i=e.attrs;for(let e=0;e<i.rowspan;e++)a[o.row+e]+=o.n;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,Kb(i,i.colspan-o.n,o.n))}else if(o.type==`missing`)a[o.row]+=o.n;else if(o.type==`overlong_rowspan`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-o.n})}else if(o.type==`colwidth mismatch`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,colwidth:o.colwidth})}else if(o.type==`zero_sized`){let e=r.mapping.map(n);r.delete(e,e+t.nodeSize)}}let o,s;for(let e=0;e<a.length;e++)a[e]&&(o??=e,s=e);for(let c=0,l=n+1;c<i.height;c++){let n=t.child(c),i=l+n.nodeSize,u=a[c];if(u>0){let t=`cell`;n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n<u;n++){let n=Ib(e.schema)[t].createAndFill();n&&a.push(n)}let d=(c==0||o==c-1)&&s==c?l+1:i-1;r.insert(r.mapping.map(d),a)}l=i}return r.setMeta(tx,{fixTables:!0})}function ax(e){let t=Db.get(e),n=[],r=t.height,i=t.width;for(let a=0;a<r;a++){let r=[];for(let n=0;n<i;n++){let o=a*i+n,s=t.map[o];if(a>0){let e=o-i;if(s===t.map[e]){r.push(null);continue}}if(n>0){let e=o-1;if(s===t.map[e]){r.push(null);continue}}r.push(e.nodeAt(s))}n.push(r)}return n}function ox(e,t){let n=[],r=Db.get(e),i=r.height,a=r.width;for(let o=0;o<i;o++){let i=e.child(o),s=[];for(let n=0;n<a;n++){let i=t[o][n];if(!i)continue;let a=r.map[o*r.width+n],c=e.nodeAt(a);if(!c)continue;let l=c.type.createChecked(i.attrs,i.content,i.marks);s.push(l)}let c=i.type.createChecked(i.attrs,s,i.marks);n.push(c)}return e.type.createChecked(e.attrs,n,e.marks)}function sx(e,t,n,r){let i=t[0]>n[0]?-1:1,a=e.splice(t[0],t.length),o=+(a.length%2==0),s;return s=r===-1&&i===1?n[0]-1:r===1&&i===-1?n[n.length-1]-o+1:i===-1?n[0]:n[n.length-1]-o,e.splice(s,0,...a),e}function cx(e){return lx(e=>e.type.spec.tableRole===`table`,e)}function lx(e,t){for(let n=t.depth;n>=0;--n){let r=t.node(n);if(e(r))return{node:r,pos:n===0?0:t.before(n),start:t.start(n),depth:n}}return null}function ux(e,t){let n=cx(t.$from);if(!n)return;let r=Db.get(n.node);if(!(e<0||e>r.width-1))return r.cellsInRect({left:e,right:e+1,top:0,bottom:r.height}).map(e=>{let t=n.node.nodeAt(e),r=e+n.start;return{pos:r,start:r+1,node:t,depth:n.depth+2}})}function dx(e,t){let n=cx(t.$from);if(!n)return;let r=Db.get(n.node);if(!(e<0||e>r.height-1))return r.cellsInRect({left:0,right:r.width,top:e,bottom:e+1}).map(e=>{let t=n.node.nodeAt(e),r=e+n.start;return{pos:r,start:r+1,node:t,depth:n.depth+2}})}function fx(e,t,n=t){let r=t,i=n;for(let n=t;n>=0;n--){let t=ux(n,e.selection);t&&t.forEach(e=>{let t=e.node.attrs.colspan+n-1;t>=r&&(r=n),t>i&&(i=t)})}for(let n=t;n<=i;n++){let t=ux(n,e.selection);t&&t.forEach(e=>{let t=e.node.attrs.colspan+n-1;e.node.attrs.colspan>1&&t>i&&(i=t)})}let a=[];for(let t=r;t<=i;t++){let n=ux(t,e.selection);n&&n.length>0&&a.push(t)}r=a[0],i=a[a.length-1];let o=ux(r,e.selection),s=dx(0,e.selection);if(!o||!s)return;let c=e.doc.resolve(o[o.length-1].pos),l;for(let t=i;t>=r;t--){let n=ux(t,e.selection);if(n&&n.length>0){for(let e=s.length-1;e>=0;e--)if(s[e].pos===n[0].pos){l=n[0];break}if(l)break}}if(l)return{$anchor:c,$head:e.doc.resolve(l.pos),indexes:a}}function px(e,t,n=t){let r=t,i=n;for(let n=t;n>=0;n--){let t=dx(n,e.selection);t&&t.forEach(e=>{let t=e.node.attrs.rowspan+n-1;t>=r&&(r=n),t>i&&(i=t)})}for(let n=t;n<=i;n++){let t=dx(n,e.selection);t&&t.forEach(e=>{let t=e.node.attrs.rowspan+n-1;e.node.attrs.rowspan>1&&t>i&&(i=t)})}let a=[];for(let t=r;t<=i;t++){let n=dx(t,e.selection);n&&n.length>0&&a.push(t)}r=a[0],i=a[a.length-1];let o=dx(r,e.selection),s=ux(0,e.selection);if(!o||!s)return;let c=e.doc.resolve(o[o.length-1].pos),l;for(let t=i;t>=r;t--){let n=dx(t,e.selection);if(n&&n.length>0){for(let e=s.length-1;e>=0;e--)if(s[e].pos===n[0].pos){l=n[0];break}if(l)break}}if(l)return{$anchor:c,$head:e.doc.resolve(l.pos),indexes:a}}function mx(e){return e[0].map((t,n)=>e.map(e=>e[n]))}function hx(e){let{tr:t,originIndex:n,targetIndex:r,select:i,pos:a}=e,o=cx(t.doc.resolve(a));if(!o)return!1;let s=fx(t,n)?.indexes,c=fx(t,r)?.indexes;if(!s||!c||s.includes(r))return!1;let l=gx(o.node,s,c,0);if(t.replaceWith(o.pos,o.pos+o.node.nodeSize,l),!i)return!0;let u=Db.get(l),d=o.start,f=r,p=u.positionAt(u.height-1,f,l),m=t.doc.resolve(d+p),h=u.positionAt(0,f,l),g=t.doc.resolve(d+h);return t.setSelection(Yb.colSelection(m,g)),!0}function gx(e,t,n,r){let i=mx(ax(e));return i=sx(i,t,n,r),i=mx(i),ox(e,i)}function _x(e){let{tr:t,originIndex:n,targetIndex:r,select:i,pos:a}=e,o=cx(t.doc.resolve(a));if(!o)return!1;let s=px(t,n)?.indexes,c=px(t,r)?.indexes;if(!s||!c||s.includes(r))return!1;let l=vx(o.node,s,c,0);if(t.replaceWith(o.pos,o.pos+o.node.nodeSize,l),!i)return!0;let u=Db.get(l),d=o.start,f=r,p=u.positionAt(f,u.width-1,l),m=t.doc.resolve(d+p),h=u.positionAt(f,0,l),g=t.doc.resolve(d+h);return t.setSelection(Yb.rowSelection(m,g)),!0}function vx(e,t,n,r){let i=ax(e);return i=sx(i,t,n,r),ox(e,i)}function yx(e){let t=e.selection,n=Bb(e),r=n.node(-1),i=n.start(-1),a=Db.get(r);return{...t instanceof Yb?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(n.pos-i),tableStart:i,map:a,table:r}}function bx(e,{map:t,tableStart:n,table:r},i){let a=i>0?-1:0;Jb(t,r,i+a)&&(a=i==0||i==t.width?null:0);for(let o=0;o<t.height;o++){let s=o*t.width+i;if(i>0&&i<t.width&&t.map[s-1]==t.map[s]){let a=t.map[s],c=r.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,qb(c.attrs,i-t.colCount(a))),o+=c.attrs.rowspan-1}else{let c=a==null?Ib(r.type.schema).cell:r.nodeAt(t.map[s+a]).type,l=t.positionAt(o,i,r);e.insert(e.mapping.map(n+l),c.createAndFill())}}return e}function xx(e,t){if(!zb(e))return!1;if(t){let n=yx(e);t(bx(e.tr,n,n.left))}return!0}function Sx(e,t){if(!zb(e))return!1;if(t){let n=yx(e);t(bx(e.tr,n,n.right))}return!0}function Cx(e,{map:t,table:n,tableStart:r},i){let a=e.mapping.maps.length;for(let o=0;o<t.height;){let s=o*t.width+i,c=t.map[s],l=n.nodeAt(c),u=l.attrs;if(i>0&&t.map[s-1]==c||i<t.width-1&&t.map[s+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(r+c),null,Kb(u,i-t.colCount(c)));else{let t=e.mapping.slice(a).map(r+c);e.delete(t,t+l.nodeSize)}o+=u.rowspan}}function wx(e,t){if(!zb(e))return!1;if(t){let n=yx(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let e=n.right-1;Cx(r,n,e),e!=n.left;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=Db.get(e)}t(r)}return!0}function Tx(e,t,n){let r=Ib(t.type.schema).header_cell;for(let i=0;i<e.width;i++)if(t.nodeAt(e.map[i+n*e.width])?.type!=r)return!1;return!0}function Ex(e,{map:t,tableStart:n,table:r},i){let a=n;for(let e=0;e<i;e++)a+=r.child(e).nodeSize;let o=[],s=i>0?-1:0;Tx(t,r,i+s)&&(s=i==0||i==t.height?null:0);for(let a=0,c=t.width*i;a<t.width;a++,c++)if(i>0&&i<t.height&&t.map[c]==t.map[c-t.width]){let i=t.map[c],o=r.nodeAt(i).attrs;e.setNodeMarkup(n+i,null,{...o,rowspan:o.rowspan+1}),a+=o.colspan-1}else{let e=(s==null?Ib(r.type.schema).cell:r.nodeAt(t.map[c+s*t.width])?.type)?.createAndFill();e&&o.push(e)}return e.insert(a,Ib(r.type.schema).row.create(null,o)),e}function Dx(e,t){if(!zb(e))return!1;if(t){let n=yx(e);t(Ex(e.tr,n,n.top))}return!0}function Ox(e,t){if(!zb(e))return!1;if(t){let n=yx(e);t(Ex(e.tr,n,n.bottom))}return!0}function kx(e,{map:t,table:n,tableStart:r},i){let a=0;for(let e=0;e<i;e++)a+=n.child(e).nodeSize;let o=a+n.child(i).nodeSize,s=e.mapping.maps.length;e.delete(a+r,o+r);let c=new Set;for(let a=0,o=i*t.width;a<t.width;a++,o++){let l=t.map[o];if(!c.has(l)){if(c.add(l),i>0&&l==t.map[o-t.width]){let t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(s).map(l+r),null,{...t,rowspan:t.rowspan-1}),a+=t.colspan-1}else if(i<t.height&&l==t.map[o+t.width]){let o=n.nodeAt(l),c=o.attrs,u=o.type.create({...c,rowspan:o.attrs.rowspan-1},o.content),d=t.positionAt(i+1,a,n);e.insert(e.mapping.slice(s).map(r+d),u),a+=c.colspan-1}}}}function Ax(e,t){if(!zb(e))return!1;if(t){let n=yx(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;kx(r,n,e),e!=n.top;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=Db.get(n.table)}t(r)}return!0}function jx(e,t){return function(n,r){if(!zb(n))return!1;let i=Bb(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){let a=n.tr;n.selection instanceof Yb?n.selection.forEachCell((n,r)=>{n.attrs[e]!==t&&a.setNodeMarkup(r,null,{...n.attrs,[e]:t})}):a.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),r(a)}return!0}}function Mx(e){return function(t,n){if(!zb(t))return!1;if(n){let r=Ib(t.schema),i=yx(t),a=t.tr,o=i.map.cellsInRect(e==`column`?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e==`row`?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=o.map(e=>i.table.nodeAt(e));for(let e=0;e<o.length;e++)s[e].type==r.header_cell&&a.setNodeMarkup(i.tableStart+o[e],r.cell,s[e].attrs);if(a.steps.length===0)for(let e=0;e<o.length;e++)a.setNodeMarkup(i.tableStart+o[e],r.header_cell,s[e].attrs);n(a)}return!0}}function Nx(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:e==`row`?t.map.width:1,bottom:e==`column`?t.map.height:1});for(let e=0;e<r.length;e++){let i=t.table.nodeAt(r[e]);if(i&&i.type!==n.header_cell)return!1}return!0}function Px(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?Mx(e):function(t,n){if(!zb(t))return!1;if(n){let r=Ib(t.schema),i=yx(t),a=t.tr,o=Nx(`row`,i,r),s=Nx(`column`,i,r),c=(e===`column`?o:e===`row`&&s)?1:0,l=e==`column`?{left:0,top:c,right:1,bottom:i.map.height}:e==`row`?{left:c,top:0,right:i.map.width,bottom:1}:i,u=e==`column`?s?r.cell:r.header_cell:e==`row`?o?r.cell:r.header_cell:r.cell;i.map.cellsInRect(l).forEach(e=>{let t=e+i.tableStart,n=a.doc.nodeAt(t);n&&a.setNodeMarkup(t,u,n.attrs)}),n(a)}return!0}}Px(`row`,{useDeprecatedLogic:!0}),Px(`column`,{useDeprecatedLogic:!0}),Px(`cell`,{useDeprecatedLogic:!0});function Fx(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t),i=r.lastChild;if(i)return n-1-i.nodeSize;n-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}function Ix(e){return function(t,n){if(!zb(t))return!1;let r=Fx(Bb(t),e);if(r==null)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(M.between(e,Ub(e))).scrollIntoView())}return!0}}function Lx(e,t){let n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole==`table`)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function Rx(e,t){let n=e.selection;if(!(n instanceof Yb))return!1;if(t){let r=e.tr,i=Ib(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new j(i,0,0))}),r.docChanged&&t(r)}return!0}function zx(e){return(t,n)=>{let{from:r,to:i,select:a=!0,pos:o=t.selection.from}=e,s=t.tr;return _x({tr:s,originIndex:r,targetIndex:i,select:a,pos:o})?(n?.(s),!0):!1}}function Bx(e){return(t,n)=>{let{from:r,to:i,select:a=!0,pos:o=t.selection.from}=e,s=t.tr;return hx({tr:s,originIndex:r,targetIndex:i,select:a,pos:o})?(n?.(s),!0):!1}}function Vx(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole==`table`);)n--,r--,t=t.child(0).content;let i=t.child(0),a=i.type.spec.tableRole,o=i.type.schema,s=[];if(a==`row`)for(let e=0;e<t.childCount;e++){let i=t.child(e).content,a=e?0:Math.max(0,n-1),c=e<t.childCount-1?0:Math.max(0,r-1);(a||c)&&(i=Ux(Ib(o).row,new j(i,a,c)).content),s.push(i)}else if(a==`cell`||a==`header_cell`)s.push(n||r?Ux(Ib(o).row,new j(t,n,r)).content:t);else return null;return Hx(o,s)}function Hx(e,t){let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let t=r.childCount-1;t>=0;t--){let{rowspan:i,colspan:a}=r.child(t).attrs;for(let t=e;t<e+i;t++)n[t]=(n[t]||0)+a}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(A.empty),n[i]<r){let a=Ib(e).cell.createAndFill(),o=[];for(let e=n[i];e<r;e++)o.push(a);t[i]=t[i].append(A.from(o))}return{height:t.length,width:r,rows:t}}function Ux(e,t){let n=e.createAndFill();return new jc(n).replace(0,n.content.size,t).doc}function Wx({width:e,height:t,rows:n},r,i){if(e!=r){let t=[],i=[];for(let e=0;e<n.length;e++){let a=n[e],o=[];for(let n=t[e]||0,i=0;n<r;i++){let s=a.child(i%a.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked(Kb(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),o.push(s),n+=s.attrs.colspan;for(let n=1;n<s.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+s.attrs.colspan}i.push(A.from(o))}n=i,e=r}if(t!=i){let e=[];for(let r=0,a=0;r<i;r++,a++){let o=[],s=n[a%t];for(let e=0;e<s.childCount;e++){let t=s.child(e);r+t.attrs.rowspan>i&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,i-t.attrs.rowspan)},t.content)),o.push(t)}e.push(A.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function Gx(e,t,n,r,i,a,o){let s=e.doc.type.schema,c=Ib(s),l,u;if(i>t.width)for(let a=0,s=0;a<t.height;a++){let d=n.child(a);s+=d.nodeSize;let f=[],p;p=d.lastChild==null||d.lastChild.type==c.cell?l||=c.cell.createAndFill():u||=c.header_cell.createAndFill();for(let e=t.width;e<i;e++)f.push(p);e.insert(e.mapping.slice(o).map(s-1+r),f)}if(a>t.height){let s=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,i);e++){let i=e>=t.width?!1:n.nodeAt(t.map[r+e]).type==c.header_cell;s.push(i?u||=c.header_cell.createAndFill():l||=c.cell.createAndFill())}let d=c.row.create(null,A.from(s)),f=[];for(let e=t.height;e<a;e++)f.push(d);e.insert(e.mapping.slice(o).map(r+n.nodeSize-2),f)}return!!(l||u)}function Kx(e,t,n,r,i,a,o,s){if(o==0||o==t.height)return!1;let c=!1;for(let l=i;l<a;l++){let i=o*t.width+l,a=t.map[i];if(t.map[i-t.width]==a){c=!0;let i=n.nodeAt(a),{top:u,left:d}=t.findCell(a);e.setNodeMarkup(e.mapping.slice(s).map(a+r),null,{...i.attrs,rowspan:o-u}),e.insert(e.mapping.slice(s).map(t.positionAt(o,d,n)),i.type.createAndFill({...i.attrs,rowspan:u+i.attrs.rowspan-o})),l+=i.attrs.colspan-1}}return c}function qx(e,t,n,r,i,a,o,s){if(o==0||o==t.width)return!1;let c=!1;for(let l=i;l<a;l++){let i=l*t.width+o,a=t.map[i];if(t.map[i-1]==a){c=!0;let i=n.nodeAt(a),u=t.colCount(a),d=e.mapping.slice(s).map(a+r);e.setNodeMarkup(d,null,Kb(i.attrs,o-u,i.attrs.colspan-(o-u))),e.insert(d+i.nodeSize,i.type.createAndFill(Kb(i.attrs,0,o-u))),l+=i.attrs.rowspan-1}}return c}function Jx(e,t,n,r,i){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw Error(`No table found`);let o=Db.get(a),{top:s,left:c}=r,l=c+i.width,u=s+i.height,d=e.tr,f=0;function p(){if(a=n?d.doc.nodeAt(n-1):d.doc,!a)throw Error(`No table found`);o=Db.get(a),f=d.mapping.maps.length}Gx(d,o,a,n,l,u,f)&&p(),Kx(d,o,a,n,c,l,s,f)&&p(),Kx(d,o,a,n,c,l,u,f)&&p(),qx(d,o,a,n,s,u,c,f)&&p(),qx(d,o,a,n,s,u,l,f)&&p();for(let e=s;e<u;e++){let t=o.positionAt(e,c,a),r=o.positionAt(e,l,a);d.replace(d.mapping.slice(f).map(t+n),d.mapping.slice(f).map(r+n),new j(i.rows[e-s],0,0))}p(),d.setSelection(new Yb(d.doc.resolve(n+o.positionAt(s,c,a)),d.doc.resolve(n+o.positionAt(u-1,l-1,a)))),t(d)}var Yx=zu({ArrowLeft:Zx(`horiz`,-1),ArrowRight:Zx(`horiz`,1),ArrowUp:Zx(`vert`,-1),ArrowDown:Zx(`vert`,1),"Shift-ArrowLeft":Qx(`horiz`,-1),"Shift-ArrowRight":Qx(`horiz`,1),"Shift-ArrowUp":Qx(`vert`,-1),"Shift-ArrowDown":Qx(`vert`,1),Backspace:Rx,"Mod-Backspace":Rx,Delete:Rx,"Mod-Delete":Rx});function Xx(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function Zx(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof Yb)return Xx(n,r,Nc.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=nS(i,e,t);if(o==null)return!1;if(e==`horiz`)return Xx(n,r,Nc.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=Gb(i,e,t),s;return s=a?Nc.near(a,1):t<0?Nc.near(n.doc.resolve(i.before(-1)),-1):Nc.near(n.doc.resolve(i.after(-1)),1),Xx(n,r,s)}}}function Qx(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof Yb)o=a;else{let r=nS(i,e,t);if(r==null)return!1;o=new Yb(n.doc.resolve(r))}let s=Gb(o.$headCell,e,t);return s?Xx(n,r,new Yb(o.$anchorCell,s)):!1}}function $x(e,t){let n=e.state.doc,r=Rb(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new Yb(r))),!0):!1}function eS(e,t,n){if(!zb(e.state))return!1;let r=Vx(n),i=e.state.selection;if(i instanceof Yb){r||={width:1,height:1,rows:[A.from(Ux(Ib(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=Db.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=Wx(r,o.right-o.left,o.bottom-o.top),Jx(e.state,e.dispatch,a,o,r),!0}else if(r){let t=Bb(e.state),n=t.start(-1);return Jx(e.state,e.dispatch,n,Db.get(t.node(-1)).findCell(t.pos-n),r),!0}else return!1}function tS(e,t){if(t.button!=0||t.ctrlKey||t.metaKey)return;let n=rS(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof Yb)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=Rb(e.state.selection.$anchor))!=null&&iS(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=iS(e,n),i=Lb.getState(e.state)==null;if(!r||!Wb(t,r))if(i)r=t;else return;let a=new Yb(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(Lb,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),Lb.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(Lb,-1))}function o(r){let o=r,s=Lb.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(rS(e,o.target)!=n&&(c=iS(e,t),!c))return a();c&&i(c,o)}e.root.addEventListener(`mouseup`,a),e.root.addEventListener(`dragstart`,a),e.root.addEventListener(`mousemove`,o)}function nS(e,t,n){if(!(e.state.selection instanceof M))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let a=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:a.childCount))return null;if(a.type.spec.tableRole==`cell`||a.type.spec.tableRole==`header_cell`){let a=r.before(i),o=t==`vert`?n>0?`down`:`up`:n>0?`right`:`left`;return e.endOfTextblock(o)?a:null}}return null}function rS(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function iS(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&Rb(e.state.doc.resolve(r))||Rb(e.state.doc.resolve(i))}var aS=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),this.table.style.setProperty(`--default-cell-min-width`,`${t}px`),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),oS(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type==this.node.type?(this.node=e,oS(e,this.colgroup,this.table,this.defaultCellMinWidth),!0):!1}ignoreMutation(e){return e.type==`attributes`&&(e.target==this.table||this.colgroup.contains(e.target))}};function oS(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l){for(let e=0,n=0;e<l.childCount;e++){let{colspan:u,colwidth:d}=l.child(e).attrs;for(let e=0;e<u;e++,n++){let l=i==n?a:d&&d[e],u=l?l+`px`:``;if(o+=l||r,l||(s=!1),c)c.style.width!=u&&(c.style.width=u),c=c.nextSibling;else{let e=document.createElement(`col`);e.style.width=u,t.appendChild(e)}}}for(;c;){var u;let e=c.nextSibling;(u=c.parentNode)==null||u.removeChild(c),c=e}s?(n.style.width=o+`px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=o+`px`)}}var sS=new nl(`tableColumnResizing`);function cS({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=aS,lastColumnResizable:i=!0}={}){let a=new $c({key:sS,state:{init(e,t){var i;let o=(i=a.spec)==null||(i=i.props)==null?void 0:i.nodeViews,s=Ib(t.schema).table.name;return r&&o&&(o[s]=(e,t)=>new r(e,n,t)),new lS(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=sS.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{uS(t,n,e,i)},mouseleave:e=>{dS(e)},mousedown:(e,r)=>{fS(e,r,t,n)}},decorations:e=>{let t=sS.getState(e);if(t&&t.activeHandle>-1)return xS(e,t.activeHandle)},nodeViews:{}}});return a}var lS=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(sS);if(r&&r.setHandle!=null)return new e(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return Hb(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function uS(e,t,n,r){if(!e.editable)return;let i=sS.getState(e.state);if(i&&!i.dragging){let a=mS(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=hS(e,t,`left`,n):i-t.clientX<=n&&(o=hS(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=Db.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}_S(e,o)}}}function dS(e){if(!e.editable)return;let t=sS.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&_S(e,-1)}function fS(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=sS.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=pS(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(sS,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=sS.getState(e.state);r?.dragging&&(vS(e,r.activeHandle,gS(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(sS,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=sS.getState(e.state);if(i&&i.dragging){let a=gS(i.dragging,t,n);yS(e,i.activeHandle,a,r)}}return yS(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function pS(e,t,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let a=e.domAtPos(t),o=a.node.childNodes[a.offset].offsetWidth,s=n;if(r)for(let e=0;e<n;e++)r[e]&&(o-=r[e],s--);return o/s}function mS(e){for(;e&&e.nodeName!=`TD`&&e.nodeName!=`TH`;)e=e.classList&&e.classList.contains(`ProseMirror`)?null:e.parentNode;return e}function hS(e,t,n,r){let i=n==`right`?-r:r,a=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!a)return-1;let{pos:o}=a,s=Rb(e.state.doc.resolve(o));if(!s)return-1;if(n==`right`)return s.pos;let c=Db.get(s.node(-1)),l=s.start(-1),u=c.map.indexOf(s.pos-l);return u%c.width==0?-1:l+c.map[u-1]}function gS(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function _S(e,t){e.dispatch(e.state.tr.setMeta(sS,{setHandle:t}))}function vS(e,t,n){let r=e.state.doc.resolve(t),i=r.node(-1),a=Db.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,c=e.state.tr;for(let e=0;e<a.height;e++){let t=e*a.width+s;if(e&&a.map[t]==a.map[t-a.width])continue;let r=a.map[t],l=i.nodeAt(r).attrs,u=l.colspan==1?0:s-a.colCount(r);if(l.colwidth&&l.colwidth[u]==n)continue;let d=l.colwidth?l.colwidth.slice():bS(l.colspan);d[u]=n,c.setNodeMarkup(o+r,null,{...l,colwidth:d})}c.docChanged&&e.dispatch(c)}function yS(e,t,n,r){let i=e.state.doc.resolve(t),a=i.node(-1),o=i.start(-1),s=Db.get(a).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,c=e.domAtPos(i.start(-1)).node;for(;c&&c.nodeName!=`TABLE`;)c=c.parentNode;c&&oS(a,c.firstChild,c,r,s,n)}function bS(e){return Array(e).fill(0)}function xS(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return km.empty;let a=Db.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;for(let t=0;t<a.height;t++){let r=s+t*a.width;if((s==a.width-1||a.map[r]!=a.map[r+1])&&(t==0||a.map[r]!=a.map[r-a.width])){let t=a.map[r],s=o+t+i.nodeAt(t).nodeSize-1,c=document.createElement(`div`);c.className=`column-resize-handle`,sS.getState(e)?.dragging&&n.push(Em.node(o+t,o+t+i.nodeAt(t).nodeSize,{class:`column-resize-dragging`})),n.push(Em.widget(s,c))}}return km.create(e.doc,n)}function SS({allowTableNodeSelection:e=!1}={}){return new $c({key:Lb,state:{init(){return null},apply(e,t){let n=e.getMeta(Lb);if(n!=null)return n==-1?null:n;if(t==null||!e.docChanged)return t;let{deleted:r,pos:i}=e.mapping.mapResult(t);return r?null:i}},props:{decorations:Zb,handleDOMEvents:{mousedown:tS},createSelectionBetween(e){return Lb.getState(e.state)==null?null:e.state.selection},handleTripleClick:$x,handleKeyDown:Yx,handlePaste:eS},appendTransaction(t,n,r){return ex(r,rx(r,n),e)}})}var CS=typeof navigator<`u`?navigator:null,wS=CS&&CS.userAgent||``,TS=/Edge\/(\d+)/.exec(wS),ES=/MSIE \d/.exec(wS),DS=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(wS),OS=!(ES||DS||TS)&&!!CS&&/Apple Computer/.test(CS.vendor),kS=new nl(`safari-ime-span`),AS=!1,jS={key:kS,props:{decorations:MS,handleDOMEvents:{compositionstart:()=>{AS=!0},compositionend:()=>{AS=!1}}}};function MS(e){let{$from:t,$to:n,to:r}=e.selection;if(AS&&t.sameParent(n)){let t=Em.widget(r,NS,{ignoreSelection:!0,key:`safari-ime-span`});return km.create(e.doc,[t])}}function NS(e){let t=e.dom.ownerDocument.createElement(`span`);return t.className=`ProseMirror-safari-ime-span`,t}var PS=new $c(OS?jS:{key:kS});function FS(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function IS(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function LS(e,t,n){let r=Qr((n||{}).ignore||[]),i=RS(t),a=-1;for(;++a<i.length;)ci(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function RS(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([zS(e[0]),BS(e[1])])}return t}function zS(e){return typeof e==`string`?new RegExp(IS(e),`g`):e}function BS(e){return typeof e==`function`?e:function(){return e}}var VS=`phrasing`,HS=[`autolink`,`link`,`image`,`label`];function US(){return{transforms:[ZS],enter:{literalAutolink:GS,literalAutolinkEmail:KS,literalAutolinkHttp:KS,literalAutolinkWww:KS},exit:{literalAutolink:XS,literalAutolinkEmail:YS,literalAutolinkHttp:qS,literalAutolinkWww:JS}}}function WS(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:VS,notInConstruct:HS},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:VS,notInConstruct:HS},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:VS,notInConstruct:HS}]}}function GS(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function KS(e){this.config.enter.autolinkProtocol.call(this,e)}function qS(e){this.config.exit.autolinkProtocol.call(this,e)}function JS(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function YS(e){this.config.exit.autolinkEmail.call(this,e)}function XS(e){this.exit(e)}function ZS(e){LS(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,QS],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,$S]],{ignore:[`link`,`linkReference`]})}function QS(e,t,n,r,i){let a=``;if(!nC(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!eC(n)))return!1;let o=tC(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function $S(e,t,n,r){return!nC(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function eC(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function tC(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=FS(e,`(`),a=FS(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function nC(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Ye(n)||Je(n))&&(!t||n!==47)}fC.peek=dC;function rC(){this.buffer()}function iC(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function aC(){this.buffer()}function oC(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function sC(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Re(this.sliceSerialize(e)).toLowerCase(),n.label=t}function cC(e){this.exit(e)}function lC(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Re(this.sliceSerialize(e)).toLowerCase(),n.label=t}function uC(e){this.exit(e)}function dC(){return`[`}function fC(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function pC(){return{enter:{gfmFootnoteCallString:rC,gfmFootnoteCall:iC,gfmFootnoteDefinitionLabelString:aC,gfmFootnoteDefinition:oC},exit:{gfmFootnoteCallString:sC,gfmFootnoteCall:cC,gfmFootnoteDefinitionLabelString:lC,gfmFootnoteDefinition:uC}}}function mC(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:fC},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
50
|
+
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?gC:hC))),s(),o}}function hC(e,t,n){return t===0?e:gC(e,t,n)}function gC(e,t,n){return(n?``:` `)+e}var _C=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];SC.peek=CC;function vC(){return{canContainEols:[`delete`],enter:{strikethrough:bC},exit:{strikethrough:xC}}}function yC(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:_C}],handlers:{delete:SC}}}function bC(e){this.enter({type:`delete`,children:[]},e)}function xC(e){this.exit(e)}function SC(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function CC(){return`~`}function wC(e){return e.length}function TC(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||wC,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=EC(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=DC(r[d]);else{let e=DC(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
51
|
+
`)}function EC(e){return e==null?``:String(e)}function DC(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function OC(){return{enter:{table:kC,tableData:NC,tableHeader:NC,tableRow:jC},exit:{codeText:PC,table:AC,tableData:MC,tableHeader:MC,tableRow:MC}}}function kC(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function AC(e){this.exit(e),this.data.inTable=void 0}function jC(e){this.enter({type:`tableRow`,children:[]},e)}function MC(e){this.exit(e)}function NC(e){this.enter({type:`tableCell`,children:[]},e)}function PC(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,FC));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function FC(e,t){return t===`|`?t:e}function IC(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
52
|
+
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
53
|
+
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return TC(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=Hi.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function LC(){return{exit:{taskListCheckValueChecked:zC,taskListCheckValueUnchecked:zC,paragraph:BC}}}function RC(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:VC}}}function zC(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function BC(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function VC(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=Hi.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function HC(){return[US(),pC(),vC(),OC(),LC()]}function UC(e){return{extensions:[WS(),mC(e),yC(),IC(e),RC()]}}var WC={tokenize:iw,partial:!0},GC={tokenize:aw,partial:!0},KC={tokenize:ow,partial:!0},qC={tokenize:sw,partial:!0},JC={tokenize:cw,partial:!0},YC={name:`wwwAutolink`,tokenize:nw,previous:lw},XC={name:`protocolAutolink`,tokenize:rw,previous:uw},ZC={name:`emailAutolink`,tokenize:tw,previous:dw},QC={};function $C(){return{text:QC}}for(var ew=48;ew<123;)QC[ew]=ZC,ew++,ew===58?ew=65:ew===91&&(ew=97);QC[43]=ZC,QC[45]=ZC,QC[46]=ZC,QC[95]=ZC,QC[72]=[ZC,XC],QC[104]=[ZC,XC],QC[87]=[ZC,YC],QC[119]=[ZC,YC];function tw(e,t,n){let r=this,i,a;return o;function o(t){return!fw(t)||!dw.call(r,r.previous)||pw(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return fw(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(JC,u,l)(t):t===45||t===95||Be(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&ze(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function nw(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!lw.call(r,r.previous)||pw(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(WC,e.attempt(GC,e.attempt(KC,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function rw(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&uw.call(r,r.previous)&&!pw(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(ze(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||He(t)||Ke(t)||Ye(t)||Je(t)?n(t):e.attempt(GC,e.attempt(KC,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function iw(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function aw(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(qC,c,s)(t):t===null||Ke(t)||Ye(t)||t!==45&&Je(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function ow(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(qC,t,a)(o):o===null||Ke(o)||Ye(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function sw(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||Ke(o)||Ye(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||Ke(e)||Ye(e)?t(e):r(e)}function a(e){return ze(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):ze(t)?(e.consume(t),o):n(t)}}function cw(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return Be(e)?n(e):t(e)}}function lw(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ke(e)}function uw(e){return!ze(e)}function dw(e){return!(e===47||fw(e))}function fw(e){return e===43||e===45||e===46||e===95||Be(e)}function pw(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var mw={tokenize:Sw,partial:!0};function hw(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:yw,continuation:{tokenize:bw},exit:xw}},text:{91:{name:`gfmFootnoteCall`,tokenize:vw},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:gw,resolveTo:_w}}}}function gw(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=Re(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function _w(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function vw(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||Ke(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(Re(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return Ke(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function yw(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||Ke(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=Re(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return Ke(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Ze(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function bw(e,t,n){return e.check(ft,t,e.attempt(mw,t,n))}function xw(e){e.exit(`gfmFootnoteDefinition`)}function Sw(e,t,n){let r=this;return Ze(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function Cw(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&je(o,o.length,0,at(s,e.slice(r+1,n),t)),je(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),je(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=it(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=it(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var ww=class{constructor(){this.map=[]}add(e,t,n){Tw(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function Tw(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function Ew(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function Dw(){return{flow:{null:{name:`table`,tokenize:Ow,resolveAll:kw}}}}function Ow(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):k(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):qe(t)?Ze(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||Ke(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,qe(t)?Ze(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return qe(t)?Ze(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||k(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return qe(t)?Ze(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||k(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||k(n)?(e.exit(`tableRow`),t(n)):qe(n)?Ze(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||Ke(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function kw(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new ww;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(jw(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=Aw(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=Aw(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=Aw(f,t,o,i,n,d)):(o[0]=o[1],d=Aw(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&jw(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=Ew(t.events,n))}return e}function Aw(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},Mw(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=Mw(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=Mw(t.events,n[2]),a=Mw(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},Mw(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function jw(e,t,n,r,i){let a=[],o=Mw(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function Mw(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Nw={name:`tasklistCheck`,tokenize:Fw};function Pw(){return{text:{91:Nw}}}function Fw(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return Ke(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return k(r)?t(r):qe(r)?e.check({tokenize:Iw},t,n)(r):n(r)}}function Iw(e,t,n){return Ze(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Lw(e){return Pe([$C(),hw(),Cw(e),Dw(),Pw()])}var Rw={};function zw(e){let t=this,n=e||Rw,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Lw(n)),a.push(HC()),o.push(UC(n))}function Bw(e,t){return Object.assign(e,{meta:{package:`@milkdown/preset-gfm`,...t}}),e}var Vw=Kg(`strike_through`);Bw(Vw,{displayName:`Attr<strikethrough>`,group:`Strikethrough`});var Hw=Ug(`strike_through`,e=>({parseDOM:[{tag:`del`},{style:`text-decoration`,getAttrs:e=>e===`line-through`}],toDOM:t=>[`del`,e.get(Vw.key)(t)],parseMarkdown:{match:e=>e.type===`delete`,runner:(e,t,n)=>{e.openMark(n),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>e.type.name===`strike_through`,runner:(e,t)=>{e.withMark(t,`delete`)}}}));Bw(Hw.mark,{displayName:`MarkSchema<strikethrough>`,group:`Strikethrough`}),Bw(Hw.ctx,{displayName:`MarkSchemaCtx<strikethrough>`,group:`Strikethrough`});var Uw=Pg(`ToggleStrikeThrough`,e=>()=>Ml(Hw.type(e)));Bw(Uw,{displayName:`Command<ToggleStrikethrough>`,group:`Strikethrough`});var Ww=Fg(e=>ru(/(?<![\w:/])(~{1,2})(.+?)\1(?!\w|\/)/,Hw.type(e)));Bw(Ww,{displayName:`InputRule<strikethrough>`,group:`Strikethrough`});var Gw=Wg(`strikeThroughKeymap`,{ToggleStrikethrough:{shortcuts:`Mod-Alt-x`,command:e=>{let t=e.get(Uh);return()=>t.call(Uw.key)}}});Bw(Gw.ctx,{displayName:`KeymapCtx<strikethrough>`,group:`Strikethrough`}),Bw(Gw.shortcuts,{displayName:`Keymap<strikethrough>`,group:`Strikethrough`});var Kw=Fb({tableGroup:`block`,cellContent:`paragraph`,cellAttributes:{alignment:{default:`left`,getFromDOM:e=>e.style.textAlign||`left`,setDOMAttr:(e,t)=>{t.style=`text-align: ${e||`left`}`}}}}),qw=Hg(`table`,()=>({...Kw.table,content:`table_header_row table_row+`,disableDropCursor:!0,parseMarkdown:{match:e=>e.type===`table`,runner:(e,t,n)=>{let r=t.align,i=t.children.map((e,t)=>({...e,align:r,isHeader:t===0}));e.openNode(n),e.next(i),e.closeNode()}},toMarkdown:{match:e=>e.type.name===`table`,runner:(e,t)=>{let n=t.content.firstChild?.content;if(!n)return;let r=[];n.forEach(e=>{r.push(e.attrs.alignment)}),e.openNode(`table`,void 0,{align:r}),e.next(t.content),e.closeNode()}}}));Bw(qw.node,{displayName:`NodeSchema<table>`,group:`Table`}),Bw(qw.ctx,{displayName:`NodeSchemaCtx<table>`,group:`Table`});var Jw=Hg(`table_header_row`,()=>({...Kw.table_row,disableDropCursor:!0,content:`(table_header)*`,parseDOM:[{tag:`tr[data-is-header]`},{tag:`tr`,getAttrs:e=>e instanceof HTMLElement&&e.querySelector(`th`)?{}:!1}],toDOM(){return[`tr`,{"data-is-header":!0},0]},parseMarkdown:{match:e=>!!(e.type===`tableRow`&&e.isHeader),runner:(e,t,n)=>{let r=t.align,i=t.children.map((e,n)=>({...e,align:r[n],isHeader:t.isHeader}));e.openNode(n),e.next(i),e.closeNode()}},toMarkdown:{match:e=>e.type.name===`table_header_row`,runner:(e,t)=>{t.content.size!==0&&(e.openNode(`tableRow`,void 0,{isHeader:!0}),e.next(t.content),e.closeNode())}}}));Bw(Jw.node,{displayName:`NodeSchema<tableHeaderRow>`,group:`Table`}),Bw(Jw.ctx,{displayName:`NodeSchemaCtx<tableHeaderRow>`,group:`Table`});var Yw=Hg(`table_row`,()=>({...Kw.table_row,disableDropCursor:!0,content:`(table_cell)*`,parseMarkdown:{match:e=>e.type===`tableRow`,runner:(e,t,n)=>{let r=t.align,i=t.children.map((e,t)=>({...e,align:r[t]}));e.openNode(n),e.next(i),e.closeNode()}},toMarkdown:{match:e=>e.type.name===`table_row`,runner:(e,t)=>{t.content.size!==0&&(e.openNode(`tableRow`),e.next(t.content),e.closeNode())}}}));Bw(Yw.node,{displayName:`NodeSchema<tableRow>`,group:`Table`}),Bw(Yw.ctx,{displayName:`NodeSchemaCtx<tableRow>`,group:`Table`});var Xw=Hg(`table_cell`,()=>({...Kw.table_cell,disableDropCursor:!0,parseMarkdown:{match:e=>e.type===`tableCell`&&!e.isHeader,runner:(e,t,n)=>{let r=t.align;e.openNode(n,{alignment:r}).openNode(e.schema.nodes.paragraph).next(t.children).closeNode().closeNode()}},toMarkdown:{match:e=>e.type.name===`table_cell`,runner:(e,t)=>{e.openNode(`tableCell`).next(t.content).closeNode()}}}));Bw(Xw.node,{displayName:`NodeSchema<tableCell>`,group:`Table`}),Bw(Xw.ctx,{displayName:`NodeSchemaCtx<tableCell>`,group:`Table`});var Zw=Hg(`table_header`,()=>({...Kw.table_header,disableDropCursor:!0,parseMarkdown:{match:e=>e.type===`tableCell`&&!!e.isHeader,runner:(e,t,n)=>{let r=t.align;e.openNode(n,{alignment:r}),e.openNode(e.schema.nodes.paragraph),e.next(t.children),e.closeNode(),e.closeNode()}},toMarkdown:{match:e=>e.type.name===`table_header`,runner:(e,t)=>{e.openNode(`tableCell`),e.next(t.content),e.closeNode()}}}));Bw(Zw.node,{displayName:`NodeSchema<tableHeader>`,group:`Table`}),Bw(Zw.ctx,{displayName:`NodeSchemaCtx<tableHeader>`,group:`Table`});function Qw(e,t=3,n=3){let r=Array(n).fill(0).map(()=>Xw.type(e).createAndFill()),i=Array(n).fill(0).map(()=>Zw.type(e).createAndFill()),a=Array(t).fill(0).map((t,n)=>n===0?Jw.type(e).create(null,i):Yw.type(e).create(null,r));return qw.type(e).create(null,a)}function $w(e){return(t,n)=>r=>{n??=r.selection.from;let i=r.doc.resolve(n),a=Cu(e=>e.type.name===`table`)(i),o=a?{node:a.node,from:a.start}:void 0,s=e===`row`;if(o){let e=Db.get(o.node);if(t>=0&&t<(s?e.height:e.width)){let n=e.positionAt(s?t:e.height-1,s?e.width-1:t,o.node),i=r.doc.resolve(o.from+n),a=s?Yb.rowSelection:Yb.colSelection,c=e.positionAt(s?t:0,s?0:t,o.node),l=r.doc.resolve(o.from+c);return hu(r.setSelection(a(i,l)))}}return r}}var eT=$w(`row`),tT=$w(`col`);function nT(e,t,{map:n,tableStart:r,table:i},a){let o=Array(a).fill(0).reduce((e,t,n)=>e+i.child(n).nodeSize,r),s=Array(n.width).fill(0).map((t,r)=>{let a=i.nodeAt(n.map[r]);return Xw.type(e).createAndFill({alignment:a?.attrs.alignment})});return t.insert(o,Yw.type(e).create(null,s)),t}function rT(e){let t=cx(e.$from);if(!t)return;let n=Db.get(t.node);return n.cellsInRect({left:0,right:n.width,top:0,bottom:n.height}).map(e=>{let n=t.node.nodeAt(e),r=e+t.start;return{pos:r,start:r+1,node:n}})}function iT(e){let t=rT(e.selection);if(t&&t[0]){let n=e.doc.resolve(t[0].pos),r=t[t.length-1];if(r){let t=e.doc.resolve(r.pos);return hu(e.setSelection(new Yb(t,n)))}}return e}var aT=Pg(`GoToPrevTableCell`,()=>()=>Ix(-1));Bw(aT,{displayName:`Command<goToPrevTableCellCommand>`,group:`Table`});var oT=Pg(`GoToNextTableCell`,()=>()=>Ix(1));Bw(oT,{displayName:`Command<goToNextTableCellCommand>`,group:`Table`});var sT=Pg(`ExitTable`,e=>()=>(t,n)=>{if(!zb(t))return!1;let{$head:r}=t.selection,i=xu(r,qw.type(e));if(!i)return!1;let{to:a}=i,o=t.tr.replaceWith(a,a,ny.type(e).createAndFill());return o.setSelection(Nc.near(o.doc.resolve(a),1)).scrollIntoView(),n?.(o),!0});Bw(sT,{displayName:`Command<breakTableCommand>`,group:`Table`});var cT=Pg(`InsertTable`,e=>({row:t,col:n}={})=>(r,i)=>{let{selection:a,tr:o}=r,{from:s}=a,c=Qw(e,t,n),l=o.replaceSelectionWith(c),u=Nc.findFrom(l.doc.resolve(s),1,!0);return u&&l.setSelection(u),i?.(l),!0});Bw(cT,{displayName:`Command<insertTableCommand>`,group:`Table`});var lT=Pg(`MoveRow`,()=>({from:e,to:t,pos:n}={})=>zx({from:e??0,to:t??0,pos:n}));Bw(lT,{displayName:`Command<moveRowCommand>`,group:`Table`});var uT=Pg(`MoveCol`,()=>({from:e,to:t,pos:n}={})=>Bx({from:e??0,to:t??0,pos:n}));Bw(uT,{displayName:`Command<moveColCommand>`,group:`Table`});var dT=Pg(`SelectRow`,()=>(e={index:0})=>(t,n)=>{let{tr:r}=t;return!!n?.(eT(e.index,e.pos)(r))});Bw(dT,{displayName:`Command<selectRowCommand>`,group:`Table`});var fT=Pg(`SelectCol`,()=>(e={index:0})=>(t,n)=>{let{tr:r}=t;return!!n?.(tT(e.index,e.pos)(r))});Bw(fT,{displayName:`Command<selectColCommand>`,group:`Table`});var pT=Pg(`SelectTable`,()=>()=>(e,t)=>{let{tr:n}=e;return!!t?.(iT(n))});Bw(pT,{displayName:`Command<selectTableCommand>`,group:`Table`});var mT=Pg(`DeleteSelectedCells`,()=>()=>(e,t)=>{let{selection:n}=e;if(!(n instanceof Yb))return!1;let r=n.isRowSelection(),i=n.isColSelection();return r&&i?Lx(e,t):i?wx(e,t):Ax(e,t)});Bw(mT,{displayName:`Command<deleteSelectedCellsCommand>`,group:`Table`});var hT=Pg(`AddColBefore`,()=>()=>xx);Bw(hT,{displayName:`Command<addColBeforeCommand>`,group:`Table`});var gT=Pg(`AddColAfter`,()=>()=>Sx);Bw(gT,{displayName:`Command<addColAfterCommand>`,group:`Table`});var _T=Pg(`AddRowBefore`,e=>()=>(t,n)=>{if(!zb(t))return!1;if(n){let r=yx(t);n(nT(e,t.tr,r,r.top))}return!0});Bw(_T,{displayName:`Command<addRowBeforeCommand>`,group:`Table`});var vT=Pg(`AddRowAfter`,e=>()=>(t,n)=>{if(!zb(t))return!1;if(n){let r=yx(t);n(nT(e,t.tr,r,r.bottom))}return!0});Bw(vT,{displayName:`Command<addRowAfterCommand>`,group:`Table`});var yT=Pg(`SetAlign`,()=>(e=`left`)=>jx(`alignment`,e));Bw(yT,{displayName:`Command<setAlignCommand>`,group:`Table`});var bT=Fg(e=>new zl(/^\|(?<col>\d+)[xX](?<row>\d+)\|\s$/,(t,n,r,i)=>{let a=t.doc.resolve(r);if(!a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),qw.type(e)))return null;let o=Qw(e,Math.max(Number(n.groups?.row??0),2),Number(n.groups?.col)),s=t.tr.replaceRangeWith(r,i,o);return s.setSelection(M.create(s.doc,r+3)).scrollIntoView()}));Bw(bT,{displayName:`InputRule<insertTableInputRule>`,group:`Table`});var xT=Ig(e=>({run:(t,n,r)=>{if(r)return t;function i(t){let n=t.childCount,r=t.lastChild?.childCount??0;if(n===0||r===0)return ny.type(e).create();let i=t.firstChild;if(!(r>0&&i&&i.childCount===0))return t;if(n>=3){let r=t.child(1),a=[];for(let t=0;t<r.childCount;t++){let n=r.child(t);a.push(Zw.type(e).create(n.attrs,n.content,n.marks))}let o=i.type.create(i.attrs,a),s=[];for(let e=2;e<n;e++)s.push(t.child(e));return t.type.create(t.attrs,[o,...s])}let a=Array(r).fill(0).map(()=>Zw.type(e).createAndFill()),o=new j(A.from(a),0,0),s=i.replace(0,0,o);return t.replace(0,i.nodeSize,new j(A.from(s),0,0))}function a(t){let n=Yw.type(e),r=[],a=[],o=!1;function s(){if(a.length===0)return;let t=Jw.type(e).createAndFill(),n=qw.type(e).create(null,[t,...a]);r.push(i(n)),a=[]}return t.forEach(e=>{e.type===n?(o=!0,a.push(e)):(s(),r.push(e))}),s(),o?A.from(r):t}function o(t){let n=a(t),r=n!==t,s=[];return n.forEach(t=>{if(t.type===qw.type(e)){let e=i(t);e!==t&&(r=!0),s.push(e)}else if(t.childCount>0){let e=o(t.content);e===t.content?s.push(t):(r=!0,s.push(t.copy(e)))}else s.push(t)}),r?A.from(s):t}function s(t){let n=[],r=[];t.forEach(e=>r.push(e));for(let t=0;t<r.length;t++){let i=r[t],a=r[t+1];i.type===ny.type(e)&&i.content.size===0&&a&&a.type===qw.type(e)||n.push(i)}return n.length<r.length?A.from(n):t}let c=o(t.content);return c=s(c),new j(A.from(c),t.openStart,t.openEnd)}}));Bw(xT,{displayName:`PasteRule<table>`,group:`Table`});var ST=Wg(`tableKeymap`,{NextCell:{priority:100,shortcuts:[`Mod-]`,`Tab`],command:e=>{let t=e.get(Uh);return()=>t.call(oT.key)}},PrevCell:{shortcuts:[`Mod-[`,`Shift-Tab`],command:e=>{let t=e.get(Uh);return()=>t.call(aT.key)}},ExitTable:{shortcuts:[`Mod-Enter`,`Enter`],command:e=>{let t=e.get(Uh);return()=>t.call(sT.key)}}});Bw(ST.ctx,{displayName:`KeymapCtx<table>`,group:`Table`}),Bw(ST.shortcuts,{displayName:`Keymap<table>`,group:`Table`});var CT=`footnote_definition`,wT=`footnoteDefinition`,TT=Hg(`footnote_definition`,()=>({group:`block`,content:`block+`,defining:!0,attrs:{label:{default:``,validate:`string`}},parseDOM:[{tag:`dl[data-type="${CT}"]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw ue(e);return{label:e.dataset.label}},contentElement:`dd`}],toDOM:e=>{let t=e.attrs.label;return[`dl`,{"data-label":t,"data-type":CT},[`dt`,t],[`dd`,0]]},parseMarkdown:{match:({type:e})=>e===wT,runner:(e,t,n)=>{e.openNode(n,{label:t.label}).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name===CT,runner:(e,t)=>{e.openNode(wT,void 0,{label:t.attrs.label,identifier:t.attrs.label}).next(t.content).closeNode()}}}));Bw(TT.ctx,{displayName:`NodeSchemaCtx<footnodeDef>`,group:`footnote`}),Bw(TT.node,{displayName:`NodeSchema<footnodeDef>`,group:`footnote`});var ET=`footnote_reference`,DT=Hg(`footnote_reference`,()=>({group:`inline`,inline:!0,atom:!0,attrs:{label:{default:``,validate:`string`}},parseDOM:[{tag:`sup[data-type="${ET}"]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw ue(e);return{label:e.dataset.label}}}],toDOM:e=>{let t=e.attrs.label;return[`sup`,{"data-label":t,"data-type":ET},t]},parseMarkdown:{match:({type:e})=>e===`footnoteReference`,runner:(e,t,n)=>{e.addNode(n,{label:t.label})}},toMarkdown:{match:e=>e.type.name===ET,runner:(e,t)=>{e.addNode(`footnoteReference`,void 0,void 0,{label:t.attrs.label,identifier:t.attrs.label})}}}));Bw(DT.ctx,{displayName:`NodeSchemaCtx<footnodeRef>`,group:`footnote`}),Bw(DT.node,{displayName:`NodeSchema<footnodeRef>`,group:`footnote`});var OT=Jy.extendSchema(e=>t=>{let n=e(t);return{...n,attrs:{...n.attrs,checked:{default:null,validate:`boolean|null`}},parseDOM:[{tag:`li[data-item-type="task"]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw ue(e);return{label:e.dataset.label,listType:e.dataset.listType,spread:e.dataset.spread,checked:e.dataset.checked?e.dataset.checked===`true`:null}}},...n?.parseDOM||[]],toDOM:e=>n.toDOM&&e.attrs.checked==null?n.toDOM(e):[`li`,{"data-item-type":`task`,"data-label":e.attrs.label,"data-list-type":e.attrs.listType,"data-spread":e.attrs.spread,"data-checked":e.attrs.checked},0],parseMarkdown:{match:({type:e})=>e===`listItem`,runner:(e,t,r)=>{if(t.checked==null){n.parseMarkdown.runner(e,t,r);return}let i=t.label==null?`•`:`${t.label}.`,a=t.checked==null?null:!!t.checked,o=t.label==null?`bullet`:`ordered`,s=t.spread==null?`true`:`${t.spread}`;e.openNode(r,{label:i,listType:o,spread:s,checked:a}),e.next(t.children),e.closeNode()}},toMarkdown:{match:e=>e.type.name===`list_item`,runner:(e,t)=>{if(t.attrs.checked==null){n.toMarkdown.runner(e,t);return}let r=t.attrs.label,i=t.attrs.listType,a=t.attrs.spread===`true`,o=t.attrs.checked;e.openNode(`listItem`,void 0,{label:r,listType:i,spread:a,checked:o}),e.next(t.content),e.closeNode()}}}});Bw(OT.node,{displayName:`NodeSchema<taskListItem>`,group:`ListItem`}),Bw(OT.ctx,{displayName:`NodeSchemaCtx<taskListItem>`,group:`ListItem`});var kT=Fg(()=>new zl(/^\[(?<checked>\s|x)\]\s$/,(e,t,n,r)=>{let i=e.doc.resolve(n),a=0,o=i.node(a);for(;o&&o.type.name!==`list_item`;)a--,o=i.node(a);if(!o||o.attrs.checked!=null)return null;let s=t.groups?.checked===`x`,c=i.before(a),l=e.tr;return l.deleteRange(n,r).setNodeMarkup(c,void 0,{...o.attrs,checked:s}),l}));Bw(kT,{displayName:`InputRule<wrapInTaskListInputRule>`,group:`ListItem`});var AT=[Gw,ST].flat(),jT=[bT,kT],MT=[Ww],NT=[xT],PT=zg(()=>PS);Bw(PT,{displayName:`Prose<autoInsertSpanPlugin>`,group:`Prose`}),Bw(zg(()=>cS({})),{displayName:`Prose<columnResizingPlugin>`,group:`Prose`});var FT=zg(()=>SS({allowTableNodeSelection:!0}));Bw(FT,{displayName:`Prose<tableEditingPlugin>`,group:`Prose`});var IT=qg(`remarkGFM`,()=>zw);Bw(IT.plugin,{displayName:`Remark<remarkGFMPlugin>`,group:`Remark`}),Bw(IT.options,{displayName:`RemarkConfig<remarkGFMPlugin>`,group:`Remark`});var LT=new nl(`MILKDOWN_KEEP_TABLE_ALIGN_PLUGIN`);function RT(e,t){let n=0;return t.forEach((t,r,i)=>{t===e&&(n=i)}),n}var zT=zg(()=>new $c({key:LT,appendTransaction:(e,t,n)=>{let r;return t.doc!==n.doc&&n.doc.descendants((e,t)=>{if(r||=n.tr,e.type.name!==`table_cell`)return;let i=n.doc.resolve(t),a=i.node(i.depth),o=i.node(i.depth-1).firstChild;if(!o)return;let s=RT(e,a),c=o.maybeChild(s);if(!c)return;let l=c.attrs.alignment;l!==e.attrs.alignment&&r.setNodeMarkup(t,void 0,{...e.attrs,alignment:l})}),r}}));Bw(zT,{displayName:`Prose<keepTableAlignPlugin>`,group:`Prose`});var BT=[zT,PT,IT,FT].flat(),VT=[[OT,qw,Jw,Yw,Zw,Xw,TT,DT,Vw,Hw].flat(),jT,NT,MT,AT,[oT,aT,sT,cT,lT,uT,dT,fT,pT,mT,_T,vT,hT,gT,yT,Uw],BT].flat(),HT=(e,t)=>typeof e==`function`?n=>{t.action(e(n))}:()=>void 0,UT=(e,t,n)=>{if(Array.isArray(n)){n.forEach((n,r)=>{e.push({name:`${t}-${r}`,plugin:n})});return}e.push({name:t,plugin:n})},WT=(e,t={})=>{let n=[],r=t.includeRuntime??!0;return UT(n,`listener`,e.listener),UT(n,`commonmark`,e.commonmark),UT(n,`gfm`,e.gfm),UT(n,`history`,e.history),UT(n,`code-block-prism`,e.codeBlockPrism),UT(n,`code-block-language-picker`,e.codeBlockLanguagePicker),r&&(UT(n,`clipboard`,e.clipboard),UT(n,`indent`,e.indent)),UT(n,`image-delete-selection`,e.imageDeleteSelection),UT(n,`table-arrow-entry`,e.tableArrowEntry),UT(n,`math-backspace-entry`,e.mathBackspaceEntry),UT(n,`blockquote-backspace-lift`,e.blockquoteBackspaceLift),UT(n,`table-focus-actions`,e.tableFocusActions),UT(n,`selection-tooltip`,e.selectionTooltip),UT(n,`gap-cursor`,e.gapCursor),UT(n,`drop-cursor`,e.dropCursor),UT(n,`math`,e.math),UT(n,`math-inline-edit`,e.mathInlineEdit),UT(n,`math-inline-arrow-navigation`,e.mathInlineArrowNavigation),UT(n,`task-list-toggle`,e.taskListToggle),UT(n,`tab-space-indent`,e.tabSpaceIndent),UT(n,`code-block-mod-a-select`,e.codeBlockModASelect),e.slash&&UT(n,`slash`,e.slash),n};function GT(e={}){return new $c({view(t){return new KT(t,e)}})}var KT=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=fc(this.editorView.state.doc,e,this.editorView.dragging.slice);t!=null&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},qT=2,JT=`var(--zt-primary)`,YT=zg(()=>GT({color:JT,width:qT})),XT=class e extends Nc{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):Nc.near(r)}content(){return j.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new ZT(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!$T(e)||!eE(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}else if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!N.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};XT.prototype.visible=!1,XT.findFrom=XT.findGapCursorFrom,Nc.jsonID(`gapcursor`,XT);var ZT=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return XT.valid(t)?new XT(t):Nc.near(t)}};function QT(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function $T(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||QT(e.type))return!0;if(e.inlineContent)return!1}}return!0}function eE(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||QT(e.type))return!0;if(e.inlineContent)return!1}}return!0}function tE(){return new $c({props:{decorations:oE,createSelectionBetween(e,t,n){return t.pos==n.pos&&XT.valid(n)?new XT(n):null},handleClick:iE,handleKeyDown:nE,handleDOMEvents:{beforeinput:aE}}})}var nE=zu({ArrowLeft:rE(`horiz`,-1),ArrowRight:rE(`horiz`,1),ArrowUp:rE(`vert`,-1),ArrowDown:rE(`vert`,1)});function rE(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof M){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=XT.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new XT(c))),!0):!1}}function iE(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!XT.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&N.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new XT(r))),!0)}function aE(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof XT))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=A.empty;for(let e=r.length-1;e>=0;e--)i=A.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new j(i,0,0));return a.setSelection(M.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function oE(e){if(!(e.selection instanceof XT))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,km.create(e.doc,[Em.widget(e.selection.head,t,{key:`gapcursor`})])}var sE=zg(()=>tE()),cE=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),lE=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),uE=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),dE=e=>{let t=uE(e);return t.charAt(0).toUpperCase()+t.slice(1)},fE={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},pE=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},mE=(0,d.createContext)({}),hE=()=>(0,d.useContext)(mE),gE=(0,d.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:f=!1,color:p=`currentColor`,className:m=``}=hE()??{},h=r??f?Number(n??u)*24/Number(t??l):n??u;return(0,d.createElement)(`svg`,{ref:c,...fE,width:t??l??fE.width,height:t??l??fE.height,stroke:e??p,strokeWidth:h,className:cE(`lucide`,m,i),...!a&&!pE(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,d.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),_E=(e,t)=>{let n=(0,d.forwardRef)(({className:n,...r},i)=>(0,d.createElement)(gE,{ref:i,iconNode:t,className:cE(`lucide-${lE(dE(e))}`,`lucide-${e}`,n),...r}));return n.displayName=dE(e),n},vE=_E(`bold`,[[`path`,{d:`M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8`,key:`mg9rjx`}]]),yE=_E(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),bE=_E(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),xE=_E(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),SE=_E(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),CE=_E(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),wE=_E(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),TE=_E(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),EE=_E(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),DE=_E(`heading-1`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`m17 12 3-2v8`,key:`1hhhft`}]]),OE=_E(`heading-2`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1`,key:`9jr5yi`}]]),kE=_E(`heading-3`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2`,key:`68ncm8`}],[`path`,{d:`M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2`,key:`1ejuhz`}]]),AE=_E(`heading-4`,[[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17 10v3a1 1 0 0 0 1 1h3`,key:`tj5zdr`}],[`path`,{d:`M21 10v8`,key:`1kdml4`}],[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}]]),jE=_E(`heading-6`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`circle`,{cx:`19`,cy:`16`,r:`2`,key:`15mx69`}],[`path`,{d:`M20 10c-2 2-3 3.5-3 6`,key:`f35dl0`}]]),ME=_E(`heading-5`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17 13v-3h4`,key:`1nvgqp`}],[`path`,{d:`M17 17.7c.4.2.8.3 1.3.3 1.5 0 2.7-1.1 2.7-2.5S19.8 13 18.3 13H17`,key:`2nebdn`}]]),NE=_E(`image-off`,[[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}],[`path`,{d:`M10.41 10.41a2 2 0 1 1-2.83-2.83`,key:`1bzlo9`}],[`line`,{x1:`13.5`,x2:`6`,y1:`13.5`,y2:`21`,key:`1q0aeu`}],[`line`,{x1:`18`,x2:`21`,y1:`12`,y2:`15`,key:`5mozeu`}],[`path`,{d:`M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59`,key:`mmje98`}],[`path`,{d:`M21 15V5a2 2 0 0 0-2-2H9`,key:`43el77`}]]),PE=_E(`image-plus`,[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),FE=_E(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),IE=_E(`italic`,[[`line`,{x1:`19`,x2:`10`,y1:`4`,y2:`4`,key:`15jd3p`}],[`line`,{x1:`14`,x2:`5`,y1:`20`,y2:`20`,key:`bu0au3`}],[`line`,{x1:`15`,x2:`9`,y1:`4`,y2:`20`,key:`uljnxc`}]]),LE=_E(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),RE=_E(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),zE=_E(`list-ordered`,[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]),BE=_E(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),VE=_E(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),HE=_E(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),UE=_E(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),WE=_E(`sigma`,[[`path`,{d:`M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2`,key:`wuwx1p`}]]),GE=_E(`square-code`,[[`path`,{d:`m10 9-3 3 3 3`,key:`1oro0q`}],[`path`,{d:`m14 15 3-3-3-3`,key:`bz13h7`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),KE=_E(`square-function`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`path`,{d:`M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3`,key:`m1af9g`}],[`path`,{d:`M9 11.2h5.7`,key:`3zgcl2`}]]),qE=_E(`strikethrough`,[[`path`,{d:`M16 4H9a3 3 0 0 0-2.83 4`,key:`43sutm`}],[`path`,{d:`M14 12a4 4 0 0 1 0 8H6`,key:`nlfj13`}],[`line`,{x1:`4`,x2:`20`,y1:`12`,y2:`12`,key:`1e0a9i`}]]),JE=_E(`table`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]),YE=_E(`text-align-end`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M21 19H7`,key:`4cu937`}]]),XE=_E(`text-align-center`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M17 12H7`,key:`16if0g`}],[`path`,{d:`M19 19H5`,key:`vjpgq2`}]]),ZE=_E(`text-align-start`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]]),QE=_E(`text-quote`,[[`path`,{d:`M17 5H3`,key:`1cn7zz`}],[`path`,{d:`M21 12H8`,key:`scolzb`}],[`path`,{d:`M21 19H8`,key:`13qgcb`}],[`path`,{d:`M3 12v7`,key:`1ri8j3`}]]),$E=_E(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),eD=_E(`type`,[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]),tD=_E(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),nD=e=>typeof e==`string`,rD=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},iD=e=>e==null?``:String(e),aD=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},oD=/###/g,sD=e=>e&&e.includes(`###`)?e.replace(oD,`.`):e,cD=e=>!e||nD(e),lD=(e,t,n)=>{let r=nD(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(cD(e))return{};let t=sD(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return cD(e)?{}:{obj:e,k:sD(r[i])}},uD=(e,t,n)=>{let{obj:r,k:i}=lD(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=lD(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=lD(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},dD=(e,t,n,r)=>{let{obj:i,k:a}=lD(e,t,Object);i[a]=i[a]||[],i[a].push(n)},fD=(e,t)=>{let{obj:n,k:r}=lD(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},pD=(e,t,n)=>{let r=fD(e,n);return r===void 0?fD(t,n):r},mD=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?nD(e[r])||e[r]instanceof String||nD(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):mD(e[r],t[r],n):e[r]=t[r]);return e},hD=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),gD={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`,"/":`/`},_D=e=>nD(e)?e.replace(/[&<>"'\/]/g,e=>gD[e]):e,vD=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}},yD=[` `,`,`,`?`,`!`,`;`],bD=new vD(20),xD=(e,t,n)=>{t||=``,n||=``;let r=yD.filter(e=>!t.includes(e)&&!n.includes(e));if(r.length===0)return!0;let i=bD.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},SD=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].includes(typeof t)&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},CD=e=>e?.replace(/_/g,`-`),wD={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},TD=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||wD,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,`log`,``,!0)}warn(...e){return this.forward(e,`warn`,``,!0)}error(...e){return this.forward(e,`error`,``)}deprecate(...e){return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,n,r){return r&&!this.debug?null:(e=e.map(e=>nD(e)?e.replace(/[\r\n\x00-\x1F\x7F]/g,` `):e),nD(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},ED=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}once(e,t){let n=(...r)=>{t(...r),this.off(e,n)};return this.on(e,n),this}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n(e,...t)})}},DD=class extends ED{constructor(e,t={ns:[`translation`],defaultNS:`translation`}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.includes(`.`)?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):nD(n)&&i?o.push(...n.split(i)):o.push(n)));let s=fD(this.data,o);return!s&&!t&&!n&&e.includes(`.`)&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!nD(n)?s:SD(this.data?.[e]?.[t],n,i)}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.includes(`.`)&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),uD(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(nD(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.includes(`.`)&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=fD(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?mD(s,n,i):s={...s,...n},uD(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},OD={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},kD=Symbol(`i18next/PATH_KEY`);function AD(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===kD?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function jD(e,t){let{[kD]:n}=e(AD()),r=t?.keySeparator??`.`,i=t?.nsSeparator??`:`,a=t?.enableSelector===`strict`;if(n.length>1&&i){let e=t?.ns,o=a?Array.isArray(e)?e:e?[e]:null:Array.isArray(e)?e:null;if(o&&(a?o:o.length>1?o.slice(1):[]).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var MD=e=>!nD(e)&&typeof e!=`boolean`&&typeof e!=`number`,ND=class e extends ED{constructor(e,t={}){super(),aD([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=TD.create(`translator`),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=MD(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.includes(n),o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!xD(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:nD(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.includes(a[0]))&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:nD(i)?[i]:i}}translate(t,n,r){let i=typeof n==`object`?{...n}:n;if(typeof i!=`object`&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i==`object`&&(i={...i}),i||={},t==null)return``;typeof t==`function`&&(t=jD(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?jD(e,{...this.options,...i}):String(e));let a=i.returnDetails===void 0?this.options.returnDetails:i.returnDetails,o=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,{key:s,namespaces:c}=this.extractFromKey(t[t.length-1],i),l=c[c.length-1],u=i.nsSeparator===void 0?this.options.nsSeparator:i.nsSeparator;u===void 0&&(u=`:`);let d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()===`cimode`)return f?a?{res:`${l}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${u}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;let p=this.resolve(t,i),m=p?.res,h=p?.usedKey||s,g=p?.exactUsedKey||s,_=[`[object Number]`,`[object Function]`,`[object RegExp]`],v=i.joinArrays===void 0?this.options.joinArrays:i.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=i.count!==void 0&&!nD(i.count),x=e.hasDefaultValue(i),S=b?this.pluralResolver.getSuffix(d,i.count,i):``,C=i.ordinal&&b?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):``,w=b&&!i.ordinal&&i.count===0,T=w&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${C}`]||i.defaultValue,E=m;y&&!m&&x&&(E=T);let D=MD(E),ee=Object.prototype.toString.apply(E);if(y&&E&&D&&!_.includes(ee)&&!(nD(v)&&Array.isArray(E))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,E,{...i,ns:c}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(o){let e=Array.isArray(E),t=e?[]:{},n=e?g:h;for(let e in E)if(Object.prototype.hasOwnProperty.call(E,e)){let r=`${n}${o}${e}`;x&&!m?t[e]=this.translate(r,{...i,defaultValue:MD(T)?T[e]:void 0,joinArrays:!1,ns:c}):t[e]=this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=E[e])}m=t}}else if(y&&nD(v)&&Array.isArray(m))m=m.join(v),m&&=this.extendTranslation(m,t,i,r);else{let e=!1,n=!1;!this.isValidLookup(m)&&x&&(e=!0,m=T),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=x&&T!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,b&&!c?`${s}${this.pluralResolver.getSuffix(d,i.count,i)}`:s,c?T:m),o){let e=this.resolve(s,{...i,keySeparator:!1});e&&e.res&&this.logger.warn(`Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.`)}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);let n=(e,t,n)=>{let r=x&&n!==m?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,c,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,c,i),this.emit(`missingKey`,e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,i);w&&i[`defaultValue${this.options.pluralSeparator}zero`]&&!t.includes(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,i[`defaultValue${t}`]||T)})}):n(e,s,T))}m=this.extendTranslation(m,t,i,p,r),n&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${s}`),(n||e)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${s}`:s,e?m:void 0,i))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(i),p):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let a=nD(e)&&(n?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:n.interpolation.skipOnVariables),o;if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!nD(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;o<r&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...e)=>i?.[0]===e[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):this.translate(...e,t),n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,o=nD(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=OD.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,a,o;return nD(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?jD(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!nD(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(nD(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!this.checkedLoadedFor[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(this.checkedLoadedFor[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)),p.forEach(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&e.startsWith(i)&&o.push(c+e.replace(i,this.options.pluralSeparator)),o.push(c+e),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator||`_`}${t.context}`;o.push(r),u&&(t.ordinal&&e.startsWith(i)&&o.push(r+e.replace(i,this.options.pluralSeparator)),o.push(r+e),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!nD(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.startsWith(`defaultValue`)&&e[t]!==void 0)return!0;return!1}},PD=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=TD.create(`languageUtils`)}getScriptPartFromCode(e){if(e=CD(e),!e||!e.includes(`-`))return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=CD(e),!e||!e.includes(`-`))return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(nD(e)&&e.includes(`-`)){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load===`languageOnly`||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>e===r?!0:!e.includes(`-`)&&!r.includes(`-`)?!1:!!(e.includes(`-`)&&!r.includes(`-`)&&e.slice(0,e.indexOf(`-`))===r||e.startsWith(r)&&r.length>1))}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),nD(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||=e[this.getScriptPartFromCode(t)],n||=e[this.formatLanguageCode(t)],n||=e[this.getLanguagePartFromCode(t)],n||=e.default,n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return nD(e)&&(e.includes(`-`)||e.includes(`_`))?(this.options.load!==`languageOnly`&&i(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&i(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&i(this.getLanguagePartFromCode(e))):nD(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.includes(e)||i(this.formatLanguageCode(e))}),r}},FD={zero:0,one:1,two:2,few:3,many:4,other:5},ID={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},LD=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=TD.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=CD(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),ID;if(!e.match(/-|_/))return ID;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>FD[e]-FD[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix(`dev`,t,n))}},RD=(e,t,n,r=`.`,i=!0)=>{let a=pD(e,t,n);return!a&&i&&nD(n)&&(a=SD(e,n,r),a===void 0&&(a=SD(t,n,r))),a},zD=e=>e.replace(/\$/g,`$$$$`),BD=class{constructor(e={}){this.logger=TD.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?_D:t,this.escapeValue=n===void 0?!0:n,this.useRawValueToEscape=r===void 0?!1:r,this.prefix=i?hD(i):a||`{{`,this.suffix=o?hD(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u?hD(u):`-`,this.unescapeSuffix=this.unescapePrefix?``:l?hD(l):``,this.nestingPrefix=d?hD(d):f||hD(`$t(`),this.nestingSuffix=p?hD(p):m||hD(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_===void 0?!1:_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(!e.includes(this.formatSeparator)){let i=RD(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(RD(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp(),!this.escapeValue&&typeof e==`string`&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn(`nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.`);let l=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>zD(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?zD(this.escape(e)):zD(e)}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0)if(typeof l==`function`){let t=l(e,i,r);a=nD(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``;else !nD(a)&&!this.useRawValueToEscape&&(a=iD(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(!e.includes(n))return e;let r=e.split(RegExp(`${hD(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.includes(this.prefix)&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!nD(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=/{.*}/.test(r[1])?r[1].lastIndexOf(`}`)+1:r[1].indexOf(this.formatSeparator);if(c!==-1&&(s=r[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,c)),i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!nD(i))return i;nD(i)||(i=iD(i)),i||=(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),``),s.length&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}},VD=e=>{let t=e.toLowerCase().trim(),n={};if(e.includes(`(`)){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].slice(0,-1);t===`currency`&&!i.includes(`:`)?n.currency||=i.trim():t===`relativetime`&&!i.includes(`:`)?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},HD=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(CD(r),i),t[o]=s),s(n)}},UD=e=>(t,n,r)=>e(CD(n),r)(t),WD=class{constructor(e={}){this.logger=TD.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?HD:UD;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=HD(t)}format(e,t,n,r={}){if(!t||e==null)return e;let i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf(`(`)>1&&!i[0].includes(`)`)&&i.find(e=>e.includes(`)`))){let e=i.findIndex(e=>e.includes(`)`));i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:a}=VD(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}else this.logger.warn(`there was no format function for ${i}`);return e},e)}},GD=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},KD=class extends ED{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=TD.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{dD(n.loaded,[i],a),GD(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read(e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();nD(e)&&(e=this.languageUtils.toResolveHierarchy(e)),nD(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);return}if(!(n==null||n===``)){if(this.backend?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}!e||!e[0]||this.store.addResource(e[0],t,n,r)}}},qD=()=>({debug:!1,initAsync:!0,ns:[`translation`],defaultNS:[`translation`],fallbackLng:[`dev`],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:`all`,preload:!1,keySeparator:`.`,nsSeparator:`:`,pluralSeparator:`_`,contextSeparator:`_`,enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:`fallback`,saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]==`object`&&(t=e[1]),nD(e[1])&&(t.defaultValue=e[1]),nD(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),JD=e=>(nD(e.ns)&&(e.ns=[e.ns]),nD(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),nD(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes(`cimode`)&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),e),YD=()=>{},XD=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},ZD=class e extends ED{constructor(e={},t){if(super(),this.options=JD(e),this.services={},this.logger=TD,this.modules={external:[]},XD(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e==`function`&&(t=e,e={}),e.defaultNS==null&&e.ns&&(nD(e.ns)?e.defaultNS=e.ns:e.ns.includes(`translation`)||(e.defaultNS=e.ns[0]));let n=qD();this.options={...n,...this.options,...JD(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!=`function`&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler);let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?TD.init(r(this.modules.logger),this.options):TD.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:WD;let t=new PD(this.options);this.store=new DD(this.options.resources,this.options);let n=this.services;n.logger=TD,n.resourceStore=this.store,n.languageUtils=t,n.pluralResolver=new LD(t,{prepend:this.options.pluralSeparator}),e&&(n.formatter=r(e),n.formatter.init&&n.formatter.init(n,this.options),this.options.interpolation.format=n.formatter.format.bind(n.formatter)),n.interpolator=new BD(this.options),n.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},n.backendConnector=new KD(r(this.modules.backend),n.resourceStore,n,this.options),n.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(n.languageDetector=r(this.modules.languageDetector),n.languageDetector.init&&n.languageDetector.init(n,this.options.detection,this.options)),this.modules.i18nFormat&&(n.i18nFormat=r(this.modules.i18nFormat),n.i18nFormat.init&&n.i18nFormat.init(this)),this.translator=new ND(this.services,this.options),this.translator.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||=YD,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn(`init: no languageDetector is used and no lng is defined`),[`getResource`,`hasResourceBundle`,`getResourceBundle`,`getDataByLanguage`].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let i=rD(),a=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn(`init: i18next is already initialized. You should call init just once!`),this.isInitialized=!0,this.options.isClone||this.logger.log(`initialized`,this.options),this.emit(`initialized`,this.options),i.resolve(n),t(e,n)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),i}loadResources(e,t=YD){let n=t,r=nD(e)?e:this.language;if(typeof e==`function`&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return n();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&(e.includes(t)||e.push(t))})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=rD();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=YD,this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);return e.type===`backend`&&(this.modules.backend=e),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&(this.modules.languageDetector=e),e.type===`i18nFormat`&&(this.modules.i18nFormat=e),e.type===`postProcessor`&&OD.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&![`cimode`,`dev`].includes(e)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(![`cimode`,`dev`].includes(t)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&!this.languages.includes(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=rD();this.emit(`languageChanging`,e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},a=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=nD(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(nD(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{i(e,a)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,n,r){let i=r?.scopeNs,a=(e,t,...r)=>{let o;o=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(r)),o.lng=o.lng||a.lng,o.lngs=o.lngs||a.lngs;let s=o.ns!==void 0&&o.ns!==null;o.ns=o.ns||a.ns,o.keyPrefix!==``&&(o.keyPrefix=o.keyPrefix||n||a.keyPrefix);let c={...this.options,...o};Array.isArray(i)&&!s&&(c.ns=i),typeof o.keyPrefix==`function`&&(o.keyPrefix=jD(o.keyPrefix,c));let l=this.options.keySeparator||`.`,u;return o.keyPrefix&&Array.isArray(e)?u=e.map(e=>(typeof e==`function`&&(e=jD(e,c)),`${o.keyPrefix}${l}${e}`)):(typeof e==`function`&&(e=jD(e,c)),u=o.keyPrefix?`${o.keyPrefix}${l}${e}`:e),this.t(u,o)};return nD(e)?a.lng=e:a.lngs=e,a.ns=t,a.keyPrefix=n,a}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn(`hasLoadedNamespace: i18next was not initialized`,this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn(`hasLoadedNamespace: i18n.languages were undefined or empty`,this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let n=rD();return this.options.ns?(nD(e)&&(e=[e]),e.forEach(e=>{this.options.ns.includes(e)||this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=rD();nD(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>!r.includes(e)&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language),!e)return`rtl`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=`ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`),n=this.services?.languageUtils||new PD(qD());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.includes(n.getLanguagePartFromCode(e))||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=YD){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new DD(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),i),a.services.resourceStore=a.store),t.interpolation){let e={...qD().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new BD(n)}return a.translator=new ND(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();ZD.createInstance,ZD.dir,ZD.init,ZD.loadResources,ZD.reloadResources,ZD.use,ZD.changeLanguage,ZD.getFixedT,ZD.t,ZD.exists,ZD.setDefaultNamespace,ZD.hasLoadedNamespace,ZD.loadNamespaces,ZD.loadLanguages;var QD={placeholder:`Type / to open the command menu...`,initError:`Editor initialization failed. Please refresh the page and try again.`,editorAriaLabel:`Markdown editor`,mathBlockSourceAriaLabel:`Math block source`,mathBlockCopyAriaLabel:`Copy math source`,mathBlockDeleteAriaLabel:`Delete math block`,imageDeleteAriaLabel:`Delete image`,tableDeleteAriaLabel:`Delete table`,tableMoreAriaLabel:`More table actions`,tableAlignLeftAriaLabel:`Align current column left`,tableAlignCenterAriaLabel:`Align current column center`,tableAlignRightAriaLabel:`Align current column right`,tableInsertRowAboveLabel:`Insert row above`,tableInsertRowBelowLabel:`Insert row below`,tableInsertColumnLeftLabel:`Insert column left`,tableInsertColumnRightLabel:`Insert column right`,tableDeleteRowLabel:`Delete row`,tableDeleteColumnLabel:`Delete column`,mathRenderError:`Formula rendering failed. Please check the formula syntax.`,imageUploadDialogTitle:`Insert image`,imageUploadDropLabel:`Drop an image here, or choose a file`,imageUploadPickFileLabel:`Choose file`,imageUploadFileTab:`Upload file`,imageUploadUrlTab:`Image URL`,imageUploadUrlPlaceholder:`Paste image URL`,imageUploadInsertUrlLabel:`Insert URL`,imageUploadConfirmLabel:`Confirm`,imageUploadUploadingLabel:`Uploading...`,imageUploadCancelLabel:`Cancel`,imageUploadLoadFailed:`Image failed to load`,imageUploadReselectHint:`Click or drag to reselect`,imageUploadSupportsAndMax:`Supports image files, max {size}`,imageUploadFileTooLarge:`The image file is too large.`,imageUploadFileSizeExceeded:`Image size must not exceed {size}`,imageUploadInvalidType:`Please choose an image file.`,imageUploadFailed:`Image upload failed. Please try again.`,imageUploadFileReadFailed:`File read failed. Please try again.`,imageUploadInvalidUrl:`Please enter a valid image URL.`,imageUploadUrlRequired:`Please enter an image URL.`,imageUploadSelectOrEnterImage:`Please select an image or enter an image URL.`,imageUploadUploadingWait:`Image is uploading, please wait.`,selectionTooltipStrongTitle:`Bold`,selectionTooltipEmTitle:`Italic`,selectionTooltipStrikeTitle:`Strikethrough`,selectionTooltipInlineCodeTitle:`Inline code`,selectionTooltipLinkTitle:`Link`,selectionTooltipTransformLabel:`Turn into`,selectionTooltipTransformParagraphLabel:`Paragraph`,selectionTooltipTransformHeading1Label:`Heading 1`,selectionTooltipTransformHeading2Label:`Heading 2`,selectionTooltipTransformHeading3Label:`Heading 3`,selectionTooltipTransformHeading4Label:`Heading 4`,selectionTooltipTransformHeading5Label:`Heading 5`,selectionTooltipTransformHeading6Label:`Heading 6`,selectionTooltipTransformBulletListLabel:`Bullet list`,selectionTooltipTransformOrderedListLabel:`Ordered list`,selectionTooltipTransformTaskListLabel:`Task list`,selectionTooltipTransformBlockquoteLabel:`Blockquote`,selectionTooltipTransformCodeBlockLabel:`Code block`,selectionLinkInputPlaceholder:`Type or paste a link`,selectionLinkSaveAriaLabel:`Save link`,selectionLinkRemoveAriaLabel:`Remove link`,codeBlockLanguageSearchPlaceholder:`Search languages`,codeBlockLanguagePlainText:`text`,codeBlockCopyAriaLabel:`Copy code block`,codeBlockDeleteAriaLabel:`Delete code block`},$D={placeholder:`请输入 / 打开命令菜单...`,initError:`编辑器初始化失败,请刷新页面后重试。`,editorAriaLabel:`Markdown 编辑器`,mathBlockSourceAriaLabel:`公式块源码`,mathBlockCopyAriaLabel:`复制公式源码`,mathBlockDeleteAriaLabel:`删除公式块`,imageDeleteAriaLabel:`删除图片`,tableDeleteAriaLabel:`删除表格`,tableMoreAriaLabel:`更多表格操作`,tableAlignLeftAriaLabel:`当前列左对齐`,tableAlignCenterAriaLabel:`当前列居中对齐`,tableAlignRightAriaLabel:`当前列右对齐`,tableInsertRowAboveLabel:`上方插入行`,tableInsertRowBelowLabel:`下方插入行`,tableInsertColumnLeftLabel:`左侧插入列`,tableInsertColumnRightLabel:`右侧插入列`,tableDeleteRowLabel:`删除该行`,tableDeleteColumnLabel:`删除该列`,mathRenderError:`公式渲染失败,请检查公式语法。`,imageUploadDialogTitle:`插入图片`,imageUploadDropLabel:`拖拽图片到这里,或选择文件`,imageUploadPickFileLabel:`选择文件`,imageUploadFileTab:`上传文件`,imageUploadUrlTab:`图片链接`,imageUploadUrlPlaceholder:`粘贴图片链接`,imageUploadInsertUrlLabel:`插入链接`,imageUploadConfirmLabel:`确认`,imageUploadUploadingLabel:`上传中...`,imageUploadCancelLabel:`取消`,imageUploadLoadFailed:`图片加载失败`,imageUploadReselectHint:`点击或拖拽重新选择`,imageUploadSupportsAndMax:`支持图片文件,最大 {size}`,imageUploadFileTooLarge:`图片文件过大。`,imageUploadFileSizeExceeded:`图片大小不能超过 {size}`,imageUploadInvalidType:`请选择图片文件。`,imageUploadFailed:`图片上传失败,请重试。`,imageUploadFileReadFailed:`文件读取失败,请重试。`,imageUploadInvalidUrl:`请输入有效的图片链接。`,imageUploadUrlRequired:`请输入图片链接。`,imageUploadSelectOrEnterImage:`请选择图片或输入图片链接。`,imageUploadUploadingWait:`图片正在上传,请稍候。`,selectionTooltipStrongTitle:`加粗`,selectionTooltipEmTitle:`斜体`,selectionTooltipStrikeTitle:`删除线`,selectionTooltipInlineCodeTitle:`行内代码`,selectionTooltipLinkTitle:`链接`,selectionTooltipTransformLabel:`转换为`,selectionTooltipTransformParagraphLabel:`段落`,selectionTooltipTransformHeading1Label:`标题 1`,selectionTooltipTransformHeading2Label:`标题 2`,selectionTooltipTransformHeading3Label:`标题 3`,selectionTooltipTransformHeading4Label:`标题 4`,selectionTooltipTransformHeading5Label:`标题 5`,selectionTooltipTransformHeading6Label:`标题 6`,selectionTooltipTransformBulletListLabel:`无序列表`,selectionTooltipTransformOrderedListLabel:`有序列表`,selectionTooltipTransformTaskListLabel:`任务列表`,selectionTooltipTransformBlockquoteLabel:`引用块`,selectionTooltipTransformCodeBlockLabel:`代码块`,selectionLinkInputPlaceholder:`输入或粘贴链接`,selectionLinkSaveAriaLabel:`保存链接`,selectionLinkRemoveAriaLabel:`移除链接`,codeBlockLanguageSearchPlaceholder:`搜索语言`,codeBlockLanguagePlainText:`text`,codeBlockCopyAriaLabel:`复制代码块`,codeBlockDeleteAriaLabel:`删除代码块`},eO=`zh-CN`,tO={"zh-CN":{translation:$D},"en-US":{translation:QD}},nO=ZD.createInstance(),rO=!1,iO=()=>{rO||=(nO.init({resources:tO,fallbackLng:eO,lng:eO,interpolation:{escapeValue:!1}}),!0)},aO=(e=eO,t,n)=>{iO();let r={...nO.getResourceBundle(e,`translation`),...t};return n!==void 0&&(r.placeholder=n),r},oO=new Set([`http:`,`https:`,`mailto:`,`tel:`]),sO=/[\u0000-\u0020\u007f]+/g,cO=/^([a-z][a-z\d+\-.]*:)/i,lO=/[<>"'`]/,uO=new Set([`src`,`alt`,`title`,`style`]),dO=e=>{if(typeof e!=`string`)return``;let t=e.trim();if(!t||lO.test(t)||/[\u0000-\u001f\u007f]/.test(t))return``;let n=t.replace(sO,``);if(n.startsWith(`//`))return``;let r=n.match(cO)?.[1]?.toLowerCase()??``;if(!r)return t;if(!oO.has(r))return``;try{return new URL(t).toString()}catch{return``}},fO=(e,t)=>{if(typeof e!=`string`)return null;let n=e.trim();if(!n)return null;let r=new DOMParser().parseFromString(n,`text/html`),i=null;for(let e of Array.from(r.body.childNodes))if(!(e.nodeType===Node.TEXT_NODE&&!(e.textContent??``).trim())){if(e instanceof HTMLImageElement&&i===null){i=e;continue}return null}if(!i||i.tagName.toLowerCase()!==`img`)return null;for(let e of Array.from(i.attributes))if(!uO.has(e.name.toLowerCase()))return null;let a=dO(i.getAttribute(`src`)??``);return a?{src:a,alt:i.getAttribute(`alt`)??``,title:i.getAttribute(`title`)??``,style:t(i.getAttribute(`style`)??``)}:null},pO=/^\s*width\s*:\s*(\d{1,3})%\s*;?\s*$/i,mO=e=>{let t=Array.isArray(e.children)?e.children:[],n=t[0];return t.length===1&&(n?.type===`image`||n?.type===`html`&&fO(n.value,vO)!==null)?n:null},hO=e=>Math.min(100,Math.max(10,e)),gO=e=>`width: ${hO(Math.round(e))}%;`,_O=e=>{if(typeof e!=`string`)return null;let t=e.match(pO);if(!t)return null;let n=Number(t[1]);return Number.isFinite(n)?hO(n):null},vO=e=>{let t=_O(e);return t===null?``:gO(t)},yO=e=>typeof e==`string`?e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`).replace(/>/g,`>`):``,bO=e=>{let t=dO(e.src);if(!t)return``;let n=typeof e.alt==`string`?e.alt:``,r=typeof e.title==`string`?e.title:``,i=r?` title="${yO(r)}"`:``,a=vO(e.style);return`<img src="${yO(t)}" alt="${yO(n)}"${i} style="${yO(a)}">`},xO=e=>t=>{let n=e(t);return{...n,inline:!1,group:`block`,attrs:{...n.attrs,style:{default:``,validate:`string`}},parseDOM:[{tag:`img[src]`,getAttrs:e=>{let t=e,n=dO(t.getAttribute(`src`)??``);return n?{src:n,alt:t.getAttribute(`alt`)??``,title:t.getAttribute(`title`)??t.getAttribute(`alt`)??``,style:vO(t.getAttribute(`style`)??``)}:!1}}],parseMarkdown:{match:e=>e.type===`image`||e.type===`html`&&fO(e.value,vO)!==null,runner:(e,t,n)=>{if(t.type===`html`){let r=fO(t.value,vO);r&&e.addNode(n,r);return}let r=dO(String(t.url??``));r&&e.addNode(n,{src:r,alt:String(t.alt??``),title:String(t.title??``),style:``})}},toMarkdown:{match:e=>e.type.name===`image`,runner:(e,t)=>{let n=dO(t.attrs.src);if(!n)return;let r=vO(t.attrs.style);if(r){let i=bO({...t.attrs,src:n,style:r});i&&e.addNode(`html`,void 0,i);return}let i={type:`image`,title:t.attrs.title,url:n,alt:t.attrs.alt};e.addNode(`paragraph`,[i])}}}},SO=e=>t=>{let n=e(t);return{...n,parseMarkdown:{...n.parseMarkdown,runner:(e,t,r)=>{let i=mO(t);if(i){e.next(i);return}n.parseMarkdown.runner(e,t,r)}}}},CO=e=>{let t=e.get(Ey.key),n=e.get(ny.key);e.set(Ey.key,xO(t)),e.set(ny.key,SO(n))},wO=`image`,TO=`left`,EO=`right`,DO=160,OO=(e=>(0,f.renderToStaticMarkup)((0,d.createElement)(e,{size:14,strokeWidth:2,"aria-hidden":`true`})))($E),kO=e=>typeof e==`function`?e():null,AO=e=>typeof e.props.editable==`function`?e.props.editable(e.state):e.editable,jO=class{constructor(e,t,n,r){this.resizeState=null,this.isSelected=!1,this.currentImageSrc=``,this.imageLoadingStartedAt=0,this.imageLoadingFinishTimer=null,this.handleDeleteClick=e=>{e.preventDefault(),e.stopPropagation(),AO(this.view)&&this.deleteCurrentImage()},this.handleImageLoad=()=>{this.finishImageLoadingWithMinimumDuration()},this.handleImageError=()=>{this.finishImageLoadingWithMinimumDuration()},this.handleResizePointerDown=e=>{if(e.preventDefault(),e.stopPropagation(),!AO(this.view))return;let t=e.currentTarget;if(!(t instanceof HTMLElement))return;let n=t.dataset.side===TO?TO:EO,r=this.dom.parentElement;if(!r)return;let i=this.imageElement.getBoundingClientRect(),a=r.getBoundingClientRect();if(i.width<=0||a.width<=0)return;let o=hO(i.width/a.width*100);this.resizeState={side:n,startClientX:e.clientX,startWidth:i.width,containerWidth:a.width,widthPercent:o},this.dom.dataset.resizing=`true`,this.applyPreviewWidth(o),window.addEventListener(`pointermove`,this.handleResizePointerMove),window.addEventListener(`pointerup`,this.handleResizePointerUp),window.addEventListener(`pointercancel`,this.handleResizePointerUp)},this.handleResizePointerMove=e=>{if(!this.resizeState)return;e.preventDefault();let t=e.clientX-this.resizeState.startClientX,n=this.resizeState.side===TO?-t:t,r=hO((this.resizeState.startWidth+n)/this.resizeState.containerWidth*100);this.resizeState.widthPercent=r,this.applyPreviewWidth(r)},this.handleResizePointerUp=e=>{if(e.preventDefault(),!this.resizeState)return;let t=Math.round(this.resizeState.widthPercent);this.resizeState=null,delete this.dom.dataset.resizing,this.removeResizeWindowListeners(),this.commitImageWidth(t)},this.node=e,this.view=t,this.getPos=n,this.deleteAriaLabel=r.imageDeleteAriaLabel,this.dom=document.createElement(`span`),this.dom.dataset.type=wO,this.dom.className=`zt-md-image`,this.updateEditableState(),this.syncSelectedState(),this.imageElement=document.createElement(`img`),this.imageElement.addEventListener(`load`,this.handleImageLoad),this.imageElement.addEventListener(`error`,this.handleImageError),this.leftResizeHandle=this.createResizeHandle(TO),this.rightResizeHandle=this.createResizeHandle(EO),this.actionsContainer=document.createElement(`span`),this.actionsContainer.className=`zt-md-image-actions`,this.deleteButton=document.createElement(`button`),this.deleteButton.type=`button`,this.deleteButton.className=`zt-md-image-action-button zt-md-image-action-button-danger`,this.deleteButton.setAttribute(`aria-label`,this.deleteAriaLabel),this.deleteButton.innerHTML=OO,this.actionsContainer.appendChild(this.deleteButton),this.dom.append(this.imageElement,this.leftResizeHandle,this.rightResizeHandle,this.actionsContainer),this.syncFromNode(e),this.deleteButton.addEventListener(`click`,this.handleDeleteClick),this.leftResizeHandle.addEventListener(`pointerdown`,this.handleResizePointerDown),this.rightResizeHandle.addEventListener(`pointerdown`,this.handleResizePointerDown)}createResizeHandle(e){let t=document.createElement(`span`);return t.className=`zt-md-image-resize-handle zt-md-image-resize-handle-${e}`,t.dataset.side=e,t.setAttribute(`aria-hidden`,`true`),t}deleteCurrentImage(){let e=kO(this.getPos);if(e===null)return;let t=this.view.state.tr.delete(e,e+this.node.nodeSize).scrollIntoView();this.view.dispatch(t),requestAnimationFrame(()=>{this.view.focus()})}updateEditableState(){this.dom.dataset.editable=AO(this.view)?`true`:`false`}syncSelectedState(){this.dom.dataset.selected=this.isSelected?`true`:`false`}markImageLoading(){this.clearImageLoadingFinishTimer(),this.imageLoadingStartedAt=performance.now(),this.dom.dataset.loading=`true`}finishImageLoading(){this.clearImageLoadingFinishTimer(),delete this.dom.dataset.loading}finishImageLoadingWithMinimumDuration(){let e=performance.now()-this.imageLoadingStartedAt,t=Math.max(0,DO-e);if(t<=0){this.finishImageLoading();return}this.clearImageLoadingFinishTimer(),this.imageLoadingFinishTimer=window.setTimeout(()=>{this.finishImageLoading()},t)}clearImageLoadingFinishTimer(){this.imageLoadingFinishTimer!==null&&(window.clearTimeout(this.imageLoadingFinishTimer),this.imageLoadingFinishTimer=null)}removeResizeWindowListeners(){window.removeEventListener(`pointermove`,this.handleResizePointerMove),window.removeEventListener(`pointerup`,this.handleResizePointerUp),window.removeEventListener(`pointercancel`,this.handleResizePointerUp)}applyPreviewWidth(e){this.dom.style.width=`${Math.round(e)}%`,this.dom.dataset.hasWidth=`true`}commitImageWidth(e){let t=kO(this.getPos);if(t===null)return;let n={...this.node.attrs,style:gO(e)},r=this.view.state.tr.setNodeMarkup(t,void 0,n);this.view.dispatch(r),requestAnimationFrame(()=>{this.view.focus()})}syncFromNode(e){this.updateEditableState();let t=typeof e.attrs.src==`string`?e.attrs.src:``,n=typeof e.attrs.alt==`string`?e.attrs.alt:``,r=typeof e.attrs.title==`string`?e.attrs.title:``,i=_O(vO(e.attrs.style));t!==this.currentImageSrc&&t&&this.markImageLoading(),this.imageElement.setAttribute(`src`,t),this.currentImageSrc=t,this.imageElement.setAttribute(`alt`,n),r?this.imageElement.title=r:this.imageElement.removeAttribute(`title`),i===null?(this.dom.style.removeProperty(`width`),delete this.dom.dataset.hasWidth):(this.dom.style.width=`${i}%`,this.dom.dataset.hasWidth=`true`),t?this.imageElement.complete&&this.imageElement.naturalWidth>0&&this.finishImageLoadingWithMinimumDuration():this.finishImageLoading()}update(e){return e.type.name===wO?(this.node=e,this.syncFromNode(e),!0):!1}selectNode(){this.isSelected=!0,this.syncSelectedState()}deselectNode(){this.isSelected=!1,this.syncSelectedState()}stopEvent(e){let t=e.target;return t instanceof Node?this.deleteButton.contains(t)||this.leftResizeHandle.contains(t)||this.rightResizeHandle.contains(t)||this.resizeState!==null:!1}ignoreMutation(){return!0}destroy(){this.removeResizeWindowListeners(),this.clearImageLoadingFinishTimer(),this.imageElement.removeEventListener(`load`,this.handleImageLoad),this.imageElement.removeEventListener(`error`,this.handleImageError),this.deleteButton.removeEventListener(`click`,this.handleDeleteClick),this.leftResizeHandle.removeEventListener(`pointerdown`,this.handleResizePointerDown),this.rightResizeHandle.removeEventListener(`pointerdown`,this.handleResizePointerDown)}},MO=(e=aO())=>(t,n,r)=>new jO(t,n,typeof r==`function`?()=>{let e=r();return typeof e==`number`?e:0}:!1,e),NO=`image`,PO={Backspace:`before`,Delete:`after`},FO=e=>typeof e.props.editable==`function`?e.props.editable(e.state):e.editable,IO=e=>e instanceof Element?!!e.closest(`.zt-md-image-actions, .zt-md-image-resize-handle`):!1,LO=e=>e?.type.name===NO,RO=(e,t)=>!PO[t.key]||t.defaultPrevented||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||!FO(e)||IO(t.target)||IO(document.activeElement),zO=e=>{if(e.parent.type.name!==`paragraph`||e.parentOffset!==0||e.parent.textContent.length>0||e.depth<1)return null;let t=e.index(e.depth-1);if(t<=0)return null;let n=e.node(e.depth-1).child(t-1);return LO(n)?{previousBlockStart:e.before(e.depth)-n.nodeSize}:null},BO=(e,t)=>{try{return M.create(e,t)}catch{return M.near(e.resolve(t),-1)}},VO=(e,t,n)=>{n.preventDefault();let r=t.from,i=e.state.tr.delete(t.from,t.to),a=i.doc.content.size,o=Math.min(r,a);return i.setSelection(BO(i.doc,o)).scrollIntoView(),e.dispatch(i),e.focus(),!0},HO=(e,t)=>{if(t.key!==`Backspace`)return!1;let{selection:n}=e.state;if(!n.empty)return!1;let r=n.$from,i=zO(r);if(!i)return!1;let a=r.before(r.depth),o=a+r.parent.nodeSize;t.preventDefault();let s=e.state.tr;return s.delete(a,o),s.setSelection(N.create(s.doc,i.previousBlockStart)).scrollIntoView(),e.dispatch(s),e.focus(),!0},UO=(e,t)=>{if(HO(e,t))return!0;let n=PO[t.key];if(!n)return!1;let{selection:r}=e.state;if(!r.empty)return!1;let i=r.$from,a=n===`before`?i.nodeBefore:i.nodeAfter;if(!LO(a))return!1;t.preventDefault();let o=n===`before`?r.from-a.nodeSize:r.from;return e.dispatch(e.state.tr.setSelection(N.create(e.state.doc,o)).scrollIntoView()),e.focus(),!0},WO=(e,t)=>{if(RO(e,t))return!1;let{selection:n}=e.state;return n instanceof N&&LO(n.node)?VO(e,n,t):UO(e,t)},GO=zg(()=>new $c({key:new nl(`zt-md-image-delete-selection`),props:{handleKeyDown:(e,t)=>WO(e,t)}})),KO=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,qO=S,JO=(e,t)=>n=>{if(t?.variants==null)return qO(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=KO(t)||KO(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return qO(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};function YO(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function XO(...e){return t=>{let n=!1,r=e.map(e=>{let r=YO(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():YO(e[t],null)}}}}function ZO(...e){return d.useCallback(XO(...e),e)}function QO(e){let t=ek(e),n=d.forwardRef((e,n)=>{let{children:r,...i}=e,a=d.Children.toArray(r),o=a.find(nk);if(o){let e=o.props.children,r=a.map(t=>t===o?d.Children.count(e)>1?d.Children.only(null):d.isValidElement(e)?e.props.children:null:t);return(0,h.jsx)(t,{...i,ref:n,children:d.isValidElement(e)?d.cloneElement(e,void 0,r):null})}return(0,h.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}var $O=QO(`Slot`);function ek(e){let t=d.forwardRef((e,t)=>{let{children:n,...r}=e;if(d.isValidElement(n)){let e=ik(n),i=rk(r,n.props);return n.type!==d.Fragment&&(i.ref=t?XO(t,e):e),d.cloneElement(n,i)}return d.Children.count(n)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var tk=Symbol(`radix.slottable`);function nk(e){return d.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===tk}function rk(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function ik(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ak=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=QO(`Primitive.${t}`),r=d.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,h.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ok(e,t){e&&m.flushSync(()=>e.dispatchEvent(t))}function sk(e,t){let n=d.createContext(t),r=e=>{let{children:t,...r}=e,i=d.useMemo(()=>r,Object.values(r));return(0,h.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=d.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function ck(e,t=[]){let n=[];function r(t,r){let i=d.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=d.useMemo(()=>o,Object.values(o));return(0,h.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=d.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>d.createContext(e));return function(n){let r=n?.[e]||t;return d.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,lk(i,...t)]}function lk(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}typeof window<`u`&&window.document&&window.document.createElement;function uk(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var dk=globalThis?.document?d.useLayoutEffect:()=>{},fk=d.useInsertionEffect||dk;function pk({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=mk({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=d.useRef(e!==void 0);d.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,d.useCallback(t=>{if(s){let n=hk(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function mk({defaultProp:e,onChange:t}){let[n,r]=d.useState(e),i=d.useRef(n),a=d.useRef(t);return fk(()=>{a.current=t},[t]),d.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function hk(e){return typeof e==`function`}function gk(e,t){return d.useReducer((e,n)=>t[e][n]??e,e)}var _k=e=>{let{present:t,children:n}=e,r=vk(t),i=typeof n==`function`?n({present:r.isPresent}):d.Children.only(n),a=ZO(r.ref,bk(i));return typeof n==`function`||r.isPresent?d.cloneElement(i,{ref:a}):null};_k.displayName=`Presence`;function vk(e){let[t,n]=d.useState(),r=d.useRef(null),i=d.useRef(e),a=d.useRef(`none`),[o,s]=gk(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return d.useEffect(()=>{let e=yk(r.current);a.current=o===`mounted`?e:`none`},[o]),dk(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=yk(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),dk(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=yk(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=yk(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:d.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function yk(e){return e?.animationName||`none`}function bk(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var xk=d.useId||(()=>void 0),Sk=0;function Ck(e){let[t,n]=d.useState(xk());return dk(()=>{e||n(e=>e??String(Sk++))},[e]),e||(t?`radix-${t}`:``)}function wk(e){let t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>(...e)=>t.current?.(...e),[])}function Tk(e,t=globalThis?.document){let n=wk(e);d.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var Ek=`DismissableLayer`,Dk=`dismissableLayer.update`,Ok=`dismissableLayer.pointerDownOutside`,kk=`dismissableLayer.focusOutside`,Ak,jk=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Mk=d.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=d.useContext(jk),[u,f]=d.useState(null),p=u?.ownerDocument??globalThis?.document,[,m]=d.useState({}),g=ZO(t,e=>f(e)),_=Array.from(l.layers),[v]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),y=_.indexOf(v),b=u?_.indexOf(u):-1,x=l.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=Fk(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!S||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},p),w=Ik(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},p);return Tk(e=>{b===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},p),d.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Ak=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),Lk(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Ak)}},[u,p,n,l]),d.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),Lk())},[u,l]),d.useEffect(()=>{let e=()=>m({});return document.addEventListener(Dk,e),()=>document.removeEventListener(Dk,e)},[]),(0,h.jsx)(ak.div,{...c,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:uk(e.onFocusCapture,w.onFocusCapture),onBlurCapture:uk(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:uk(e.onPointerDownCapture,C.onPointerDownCapture)})});Mk.displayName=Ek;var Nk=`DismissableLayerBranch`,Pk=d.forwardRef((e,t)=>{let n=d.useContext(jk),r=d.useRef(null),i=ZO(t,r);return d.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,h.jsx)(ak.div,{...e,ref:i})});Pk.displayName=Nk;function Fk(e,t=globalThis?.document){let n=wk(e),r=d.useRef(!1),i=d.useRef(()=>{});return d.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){Rk(Ok,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Ik(e,t=globalThis?.document){let n=wk(e),r=d.useRef(!1);return d.useEffect(()=>{let e=e=>{e.target&&!r.current&&Rk(kk,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Lk(){let e=new CustomEvent(Dk);document.dispatchEvent(e)}function Rk(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?ok(i,a):i.dispatchEvent(a)}var zk=`focusScope.autoFocusOnMount`,Bk=`focusScope.autoFocusOnUnmount`,Vk={bubbles:!1,cancelable:!0},Hk=`FocusScope`,Uk=d.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=d.useState(null),l=wk(i),u=wk(a),f=d.useRef(null),p=ZO(t,e=>c(e)),m=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(r){let e=function(e){if(m.paused||!s)return;let t=e.target;s.contains(t)?f.current=t:Xk(f.current,{select:!0})},t=function(e){if(m.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Xk(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Xk(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,m.paused]),d.useEffect(()=>{if(s){Zk.add(m);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(zk,Vk);s.addEventListener(zk,l),s.dispatchEvent(t),t.defaultPrevented||(Wk(eA(Kk(s)),{select:!0}),document.activeElement===e&&Xk(s))}return()=>{s.removeEventListener(zk,l),setTimeout(()=>{let t=new CustomEvent(Bk,Vk);s.addEventListener(Bk,u),s.dispatchEvent(t),t.defaultPrevented||Xk(e??document.body,{select:!0}),s.removeEventListener(Bk,u),Zk.remove(m)},0)}}},[s,l,u,m]);let g=d.useCallback(e=>{if(!n&&!r||m.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Gk(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Xk(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Xk(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,m.paused]);return(0,h.jsx)(ak.div,{tabIndex:-1,...o,ref:p,onKeyDown:g})});Uk.displayName=Hk;function Wk(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Xk(r,{select:t}),document.activeElement!==n)return}function Gk(e){let t=Kk(e);return[qk(t,e),qk(t.reverse(),e)]}function Kk(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function qk(e,t){for(let n of e)if(!Jk(n,{upTo:t}))return n}function Jk(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Yk(e){return e instanceof HTMLInputElement&&`select`in e}function Xk(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Yk(e)&&t&&e.select()}}var Zk=Qk();function Qk(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=$k(e,t),e.unshift(t)},remove(t){e=$k(e,t),e[0]?.resume()}}}function $k(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function eA(e){return e.filter(e=>e.tagName!==`A`)}var tA=`Portal`,nA=d.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=d.useState(!1);dk(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?m.default.createPortal((0,h.jsx)(ak.div,{...r,ref:t}),o):null});nA.displayName=tA;var rA=0;function iA(){d.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??aA()),document.body.insertAdjacentElement(`beforeend`,e[1]??aA()),rA++,()=>{rA===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),rA--}},[])}function aA(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var oA=function(){return oA=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},oA.apply(this,arguments)};function sA(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function cA(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var lA=`right-scroll-bar-position`,uA=`width-before-scroll-bar`,dA=`with-scroll-bars-hidden`,fA=`--removed-body-scroll-bar-size`;function pA(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function mA(e,t){var n=(0,u.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var hA=typeof window<`u`?u.useLayoutEffect:u.useEffect,gA=new WeakMap;function _A(e,t){var n=mA(t||null,function(t){return e.forEach(function(e){return pA(e,t)})});return hA(function(){var t=gA.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||pA(e,null)}),i.forEach(function(e){r.has(e)||pA(e,a)})}gA.set(n,e)},[e]),n}function vA(e){return e}function yA(e,t){t===void 0&&(t=vA);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function bA(e){e===void 0&&(e={});var t=yA(null);return t.options=oA({async:!0,ssr:!1},e),t}var xA=function(e){var t=e.sideCar,n=sA(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return u.createElement(r,oA({},n))};xA.isSideCarExport=!0;function SA(e,t){return e.useMedium(t),xA}var CA=bA(),wA=function(){},TA=u.forwardRef(function(e,t){var n=u.useRef(null),r=u.useState({onScrollCapture:wA,onWheelCapture:wA,onTouchMoveCapture:wA}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=sA(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=_A([n,t]),w=oA(oA({},x),i);return u.createElement(u.Fragment,null,d&&u.createElement(S,{sideCar:CA,removeScrollBar:l,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?u.cloneElement(u.Children.only(s),oA(oA({},w),{ref:C})):u.createElement(y,oA({},w,{className:c,ref:C}),s))});TA.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},TA.classNames={fullWidth:uA,zeroRight:lA};var EA,DA=function(){if(EA)return EA;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function OA(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=DA();return t&&e.setAttribute(`nonce`,t),e}function kA(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function AA(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var jA=function(){var e=0,t=null;return{add:function(n){e==0&&(t=OA())&&(kA(t,n),AA(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},MA=function(){var e=jA();return function(t,n){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},NA=function(){var e=MA();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},PA={left:0,top:0,right:0,gap:0},FA=function(e){return parseInt(e||``,10)||0},IA=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[FA(n),FA(r),FA(i)]},LA=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return PA;var t=IA(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},RA=NA(),zA=`data-scroll-locked`,BA=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
54
|
+
.${dA} {
|
|
3
55
|
overflow: hidden ${r};
|
|
4
56
|
padding-right: ${s}px ${r};
|
|
5
57
|
}
|
|
6
|
-
body[${
|
|
58
|
+
body[${zA}] {
|
|
7
59
|
overflow: hidden ${r};
|
|
8
60
|
overscroll-behavior: contain;
|
|
9
61
|
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
@@ -16,33 +68,33 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
16
68
|
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
17
69
|
}
|
|
18
70
|
|
|
19
|
-
.${
|
|
71
|
+
.${lA} {
|
|
20
72
|
right: ${s}px ${r};
|
|
21
73
|
}
|
|
22
74
|
|
|
23
|
-
.${
|
|
75
|
+
.${uA} {
|
|
24
76
|
margin-right: ${s}px ${r};
|
|
25
77
|
}
|
|
26
78
|
|
|
27
|
-
.${
|
|
79
|
+
.${lA} .${lA} {
|
|
28
80
|
right: 0 ${r};
|
|
29
81
|
}
|
|
30
82
|
|
|
31
|
-
.${
|
|
83
|
+
.${uA} .${uA} {
|
|
32
84
|
margin-right: 0 ${r};
|
|
33
85
|
}
|
|
34
86
|
|
|
35
|
-
body[${
|
|
36
|
-
${
|
|
87
|
+
body[${zA}] {
|
|
88
|
+
${fA}: ${s}px;
|
|
37
89
|
}
|
|
38
|
-
`},
|
|
90
|
+
`},VA=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},HA=function(){u.useEffect(function(){return document.body.setAttribute(zA,(VA()+1).toString()),function(){var e=VA()-1;e<=0?document.body.removeAttribute(zA):document.body.setAttribute(zA,e.toString())}},[])},UA=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;HA();var a=u.useMemo(function(){return LA(i)},[i]);return u.createElement(RA,{styles:BA(a,!t,i,n?``:`!important`)})},WA=!1;if(typeof window<`u`)try{var GA=Object.defineProperty({},"passive",{get:function(){return WA=!0,!0}});window.addEventListener(`test`,GA,GA),window.removeEventListener(`test`,GA,GA)}catch{WA=!1}var KA=WA?{passive:!1}:!1,qA=function(e){return e.tagName===`TEXTAREA`},JA=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!qA(e)&&n[t]===`visible`)},YA=function(e){return JA(e,`overflowY`)},XA=function(e){return JA(e,`overflowX`)},ZA=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),ej(e,r)){var i=tj(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},QA=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},$A=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},ej=function(e,t){return e===`v`?YA(t):XA(t)},tj=function(e,t){return e===`v`?QA(t):$A(t)},nj=function(e,t){return e===`h`&&t===`rtl`?-1:1},rj=function(e,t,n,r,i){var a=nj(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=tj(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&ej(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},ij=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},aj=function(e){return[e.deltaX,e.deltaY]},oj=function(e){return e&&`current`in e?e.current:e},sj=function(e,t){return e[0]===t[0]&&e[1]===t[1]},cj=function(e){return`
|
|
39
91
|
.block-interactivity-${e} {pointer-events: none;}
|
|
40
92
|
.allow-interactivity-${e} {pointer-events: all;}
|
|
41
|
-
`},
|
|
93
|
+
`},lj=0,uj=[];function dj(e){var t=u.useRef([]),n=u.useRef([0,0]),r=u.useRef(),i=u.useState(lj++)[0],a=u.useState(NA)[0],o=u.useRef(e);u.useEffect(function(){o.current=e},[e]),u.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=cA([e.lockRef.current],(e.shards||[]).map(oj),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=u.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=ij(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=ZA(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=ZA(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return rj(h,t,e,h===`h`?s:c,!0)},[]),c=u.useCallback(function(e){var n=e;if(!(!uj.length||uj[uj.length-1]!==a)){var r=`deltaY`in n?aj(n):ij(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&sj(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(oj).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=u.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:fj(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=u.useCallback(function(e){n.current=ij(e),r.current=void 0},[]),f=u.useCallback(function(t){l(t.type,aj(t),t.target,s(t,e.lockRef.current))},[]),p=u.useCallback(function(t){l(t.type,ij(t),t.target,s(t,e.lockRef.current))},[]);u.useEffect(function(){return uj.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,c,KA),document.addEventListener(`touchmove`,c,KA),document.addEventListener(`touchstart`,d,KA),function(){uj=uj.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,KA),document.removeEventListener(`touchmove`,c,KA),document.removeEventListener(`touchstart`,d,KA)}},[]);var m=e.removeScrollBar,h=e.inert;return u.createElement(u.Fragment,null,h?u.createElement(a,{styles:cj(i)}):null,m?u.createElement(UA,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function fj(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var pj=SA(CA,dj),mj=u.forwardRef(function(e,t){return u.createElement(TA,oA({},e,{ref:t,sideCar:pj}))});mj.classNames=TA.classNames;var hj=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},gj=new WeakMap,_j=new WeakMap,vj={},yj=0,bj=function(e){return e&&(e.host||bj(e.parentNode))},xj=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=bj(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Sj=function(e,t,n,r){var i=xj(t,Array.isArray(e)?e:[e]);vj[n]||(vj[n]=new WeakMap);var a=vj[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(gj.get(e)||0)+1,l=(a.get(e)||0)+1;gj.set(e,c),a.set(e,l),o.push(e),c===1&&i&&_j.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),yj++,function(){o.forEach(function(e){var t=gj.get(e)-1,i=a.get(e)-1;gj.set(e,t),a.set(e,i),t||(_j.has(e)||e.removeAttribute(r),_j.delete(e)),i||e.removeAttribute(n)}),yj--,yj||(gj=new WeakMap,gj=new WeakMap,_j=new WeakMap,vj={})}},Cj=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||hj(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Sj(r,i,n,`aria-hidden`)):function(){return null}},wj=`Dialog`,[Tj,Ej]=ck(wj),[Dj,Oj]=Tj(wj),kj=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=d.useRef(null),c=d.useRef(null),[l,u]=pk({prop:r,defaultProp:i??!1,onChange:a,caller:wj});return(0,h.jsx)(Dj,{scope:t,triggerRef:s,contentRef:c,contentId:Ck(),titleId:Ck(),descriptionId:Ck(),open:l,onOpenChange:u,onOpenToggle:d.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};kj.displayName=wj;var Aj=`DialogTrigger`,jj=d.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Oj(Aj,n),a=ZO(t,i.triggerRef);return(0,h.jsx)(ak.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Zj(i.open),...r,ref:a,onClick:uk(e.onClick,i.onOpenToggle)})});jj.displayName=Aj;var Mj=`DialogPortal`,[Nj,Pj]=Tj(Mj,{forceMount:void 0}),Fj=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Oj(Mj,t);return(0,h.jsx)(Nj,{scope:t,forceMount:n,children:d.Children.map(r,e=>(0,h.jsx)(_k,{present:n||a.open,children:(0,h.jsx)(nA,{asChild:!0,container:i,children:e})}))})};Fj.displayName=Mj;var Ij=`DialogOverlay`,Lj=d.forwardRef((e,t)=>{let n=Pj(Ij,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Oj(Ij,e.__scopeDialog);return a.modal?(0,h.jsx)(_k,{present:r||a.open,children:(0,h.jsx)(zj,{...i,ref:t})}):null});Lj.displayName=Ij;var Rj=QO(`DialogOverlay.RemoveScroll`),zj=d.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Oj(Ij,n);return(0,h.jsx)(mj,{as:Rj,allowPinchZoom:!0,shards:[i.contentRef],children:(0,h.jsx)(ak.div,{"data-state":Zj(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),Bj=`DialogContent`,Vj=d.forwardRef((e,t)=>{let n=Pj(Bj,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Oj(Bj,e.__scopeDialog);return(0,h.jsx)(_k,{present:r||a.open,children:a.modal?(0,h.jsx)(Hj,{...i,ref:t}):(0,h.jsx)(Uj,{...i,ref:t})})});Vj.displayName=Bj;var Hj=d.forwardRef((e,t)=>{let n=Oj(Bj,e.__scopeDialog),r=d.useRef(null),i=ZO(t,n.contentRef,r);return d.useEffect(()=>{let e=r.current;if(e)return Cj(e)},[]),(0,h.jsx)(Wj,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:uk(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:uk(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:uk(e.onFocusOutside,e=>e.preventDefault())})}),Uj=d.forwardRef((e,t)=>{let n=Oj(Bj,e.__scopeDialog),r=d.useRef(!1),i=d.useRef(!1);return(0,h.jsx)(Wj,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),Wj=d.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Oj(Bj,n),c=d.useRef(null),l=ZO(t,c);return iA(),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Uk,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,h.jsx)(Mk,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Zj(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(tM,{titleId:s.titleId}),(0,h.jsx)(rM,{contentRef:c,descriptionId:s.descriptionId})]})]})}),Gj=`DialogTitle`,Kj=d.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Oj(Gj,n);return(0,h.jsx)(ak.h2,{id:i.titleId,...r,ref:t})});Kj.displayName=Gj;var qj=`DialogDescription`,Jj=d.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Oj(qj,n);return(0,h.jsx)(ak.p,{id:i.descriptionId,...r,ref:t})});Jj.displayName=qj;var Yj=`DialogClose`,Xj=d.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Oj(Yj,n);return(0,h.jsx)(ak.button,{type:`button`,...r,ref:t,onClick:uk(e.onClick,()=>i.onOpenChange(!1))})});Xj.displayName=Yj;function Zj(e){return e?`open`:`closed`}var Qj=`DialogTitleWarning`,[$j,eM]=sk(Qj,{contentName:Bj,titleName:Gj,docsSlug:`dialog`}),tM=({titleId:e})=>{let t=eM(Qj),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
42
94
|
|
|
43
95
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
44
96
|
|
|
45
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return u.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},ao=`DialogDescriptionWarning`,oo=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ro(ao).contentName}}.`;return u.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},so=Ma,co=Pa,lo=Ra,uo=Ba,fo=Wa,po=Ya,mo=Za,ho=$a;function go(e){let[t,n]=u.useState(void 0);return mr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var _o=typeof document<`u`?u.useLayoutEffect:function(){};function vo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!vo(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!vo(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function yo(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function bo(e,t){let n=yo(e);return Math.round(t*n)/n}function xo(e){let t=u.useRef(e);return _o(()=>{t.current=e}),t}function So(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:s}={},transform:c=!0,whileElementsMounted:l,open:d}=e,[f,m]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,g]=u.useState(r);vo(h,r)||g(r);let[_,v]=u.useState(null),[y,b]=u.useState(null),x=u.useCallback(e=>{e!==T.current&&(T.current=e,v(e))},[]),S=u.useCallback(e=>{e!==E.current&&(E.current=e,b(e))},[]),C=a||_,w=s||y,T=u.useRef(null),E=u.useRef(null),ee=u.useRef(f),te=l!=null,D=xo(l),ne=xo(i),re=xo(d),ie=u.useCallback(()=>{if(!T.current||!E.current)return;let e={placement:t,strategy:n,middleware:h};ne.current&&(e.platform=ne.current),o.r(T.current,E.current,e).then(e=>{let t={...e,isPositioned:re.current!==!1};ae.current&&!vo(ee.current,t)&&(ee.current=t,p.flushSync(()=>{m(t)}))})},[h,t,n,ne,re]);_o(()=>{d===!1&&ee.current.isPositioned&&(ee.current.isPositioned=!1,m(e=>({...e,isPositioned:!1})))},[d]);let ae=u.useRef(!1);_o(()=>(ae.current=!0,()=>{ae.current=!1}),[]),_o(()=>{if(C&&(T.current=C),w&&(E.current=w),C&&w){if(D.current)return D.current(C,w,ie);ie()}},[C,w,ie,D,te]);let oe=u.useMemo(()=>({reference:T,floating:E,setReference:x,setFloating:S}),[x,S]),se=u.useMemo(()=>({reference:C,floating:w}),[C,w]),O=u.useMemo(()=>{let e={position:n,left:0,top:0};if(!se.floating)return e;let t=bo(se.floating,f.x),r=bo(se.floating,f.y);return c?{...e,transform:`translate(`+t+`px, `+r+`px)`,...yo(se.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,c,se.floating,f.x,f.y]);return u.useMemo(()=>({...f,update:ie,refs:oe,elements:se,floatingStyles:O}),[f,ie,oe,se,O])}var Co=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:o.t({element:r.current,padding:i}).fn(n):r?o.t({element:r,padding:i}).fn(n):{}}}},wo=(e,t)=>{let n=o.s(e);return{name:n.name,fn:n.fn,options:[e,t]}},To=(e,t)=>{let n=o.c(e);return{name:n.name,fn:n.fn,options:[e,t]}},Eo=(e,t)=>({fn:o.o(e).fn,options:[e,t]}),Do=(e,t)=>{let n=o.i(e);return{name:n.name,fn:n.fn,options:[e,t]}},Oo=(e,t)=>{let n=o.l(e);return{name:n.name,fn:n.fn,options:[e,t]}},ko=(e,t)=>{let n=o.a(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ao=(e,t)=>{let n=Co(e);return{name:n.name,fn:n.fn,options:[e,t]}},jo=`Arrow`,Mo=u.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,m.jsx)(cr.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,m.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});Mo.displayName=jo;var No=Mo,Po=`Popper`,[Fo,Io]=dr(Po),[Lo,Ro]=Fo(Po),zo=e=>{let{__scopePopper:t,children:n}=e,[r,i]=u.useState(null);return(0,m.jsx)(Lo,{scope:t,anchor:r,onAnchorChange:i,children:n})};zo.displayName=Po;var Bo=`PopperAnchor`,Vo=u.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Ro(Bo,n),o=u.useRef(null),s=er(t,o),c=u.useRef(null);return u.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,m.jsx)(cr.div,{...i,ref:s})});Vo.displayName=Bo;var Ho=`PopperContent`,[Uo,Wo]=Fo(Ho),Go=u.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:s=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p=`partial`,hideWhenDetached:h=!1,updatePositionStrategy:g=`optimized`,onPlaced:_,...v}=e,y=Ro(Ho,n),[b,x]=u.useState(null),S=er(t,e=>x(e)),[C,w]=u.useState(null),T=go(C),E=T?.width??0,ee=T?.height??0,te=r+(a===`center`?``:`-`+a),D=typeof f==`number`?f:{top:0,right:0,bottom:0,left:0,...f},ne=Array.isArray(d)?d:[d],re=ne.length>0,ie={padding:D,boundary:ne.filter(Yo),altBoundary:re},{refs:ae,floatingStyles:oe,placement:se,isPositioned:O,middlewareData:ce}=So({strategy:`fixed`,placement:te,whileElementsMounted:(...e)=>o.n(...e,{animationFrame:g===`always`}),elements:{reference:y.anchor},middleware:[wo({mainAxis:i+ee,alignmentAxis:s}),l&&To({mainAxis:!0,crossAxis:!1,limiter:p===`partial`?Eo():void 0,...ie}),l&&Do({...ie}),Oo({...ie,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),C&&Ao({element:C,padding:c}),Xo({arrowWidth:E,arrowHeight:ee}),h&&ko({strategy:`referenceHidden`,...ie})]}),[le,ue]=Zo(se),de=Dr(_);mr(()=>{O&&de?.()},[O,de]);let fe=ce.arrow?.x,pe=ce.arrow?.y,me=ce.arrow?.centerOffset!==0,[he,ge]=u.useState();return mr(()=>{b&&ge(window.getComputedStyle(b).zIndex)},[b]),(0,m.jsx)(`div`,{ref:ae.setFloating,"data-radix-popper-content-wrapper":``,style:{...oe,transform:O?oe.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:he,"--radix-popper-transform-origin":[ce.transformOrigin?.x,ce.transformOrigin?.y].join(` `),...ce.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,m.jsx)(Uo,{scope:n,placedSide:le,onArrowChange:w,arrowX:fe,arrowY:pe,shouldHideArrow:me,children:(0,m.jsx)(cr.div,{"data-side":le,"data-align":ue,...v,ref:S,style:{...v.style,animation:O?void 0:`none`}})})})});Go.displayName=Ho;var Ko=`PopperArrow`,qo={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Jo=u.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Wo(Ko,n),a=qo[i.placedSide];return(0,m.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,m.jsx)(No,{...r,ref:t,style:{...r.style,display:`block`}})})});Jo.displayName=Ko;function Yo(e){return e!==null}var Xo=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Zo(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Zo(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Qo=zo,$o=Vo,es=Go,ts=Jo,ns=`Popover`,[rs,is]=dr(ns,[Io]),as=Io(),[os,ss]=rs(ns),cs=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=as(t),c=u.useRef(null),[l,d]=u.useState(!1),[f,p]=gr({prop:r,defaultProp:i??!1,onChange:a,caller:ns});return(0,m.jsx)(Qo,{...s,children:(0,m.jsx)(os,{scope:t,contentId:Er(),triggerRef:c,open:f,onOpenChange:p,onOpenToggle:u.useCallback(()=>p(e=>!e),[p]),hasCustomAnchor:l,onCustomAnchorAdd:u.useCallback(()=>d(!0),[]),onCustomAnchorRemove:u.useCallback(()=>d(!1),[]),modal:o,children:n})})};cs.displayName=ns;var ls=`PopoverAnchor`,us=u.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=ss(ls,n),a=as(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return u.useEffect(()=>(o(),()=>s()),[o,s]),(0,m.jsx)($o,{...a,...r,ref:t})});us.displayName=ls;var ds=`PopoverTrigger`,fs=u.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=ss(ds,n),a=as(n),o=er(t,i.triggerRef),s=(0,m.jsx)(cr.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Ds(i.open),...r,ref:o,onClick:pr(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,m.jsx)($o,{asChild:!0,...a,children:s})});fs.displayName=ds;var ps=`PopoverPortal`,[ms,hs]=rs(ps,{forceMount:void 0}),gs=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=ss(ps,t);return(0,m.jsx)(ms,{scope:t,forceMount:n,children:(0,m.jsx)(br,{present:n||a.open,children:(0,m.jsx)(ai,{asChild:!0,container:i,children:r})})})};gs.displayName=ps;var _s=`PopoverContent`,vs=u.forwardRef((e,t)=>{let n=hs(_s,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=ss(_s,e.__scopePopover);return(0,m.jsx)(br,{present:r||a.open,children:a.modal?(0,m.jsx)(bs,{...i,ref:t}):(0,m.jsx)(xs,{...i,ref:t})})});vs.displayName=_s;var ys=tr(`PopoverContent.RemoveScroll`),bs=u.forwardRef((e,t)=>{let n=ss(_s,e.__scopePopover),r=u.useRef(null),i=er(t,r),a=u.useRef(!1);return u.useEffect(()=>{let e=r.current;if(e)return Ea(e)},[]),(0,m.jsx)(_a,{as:ys,allowPinchZoom:!0,children:(0,m.jsx)(Ss,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:pr(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:pr(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:pr(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),xs=u.forwardRef((e,t)=>{let n=ss(_s,e.__scopePopover),r=u.useRef(!1),i=u.useRef(!1);return(0,m.jsx)(Ss,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),Ss=u.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=ss(_s,n),p=as(n);return si(),(0,m.jsx)(Kr,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,m.jsx)(Fr,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,m.jsx)(es,{"data-state":Ds(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),Cs=`PopoverClose`,ws=u.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=ss(Cs,n);return(0,m.jsx)(cr.button,{type:`button`,...r,ref:t,onClick:pr(e.onClick,()=>i.onOpenChange(!1))})});ws.displayName=Cs;var Ts=`PopoverArrow`,Es=u.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=as(n);return(0,m.jsx)(ts,{...i,...r,ref:t})});Es.displayName=Ts;function Ds(e){return e?`open`:`closed`}var Os=cs,ks=fs,As=gs,js=vs,Ms=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Ns=(e,t)=>({classGroupId:e,validator:t}),Ps=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Fs=`-`,Is=[],Ls=`arbitrary..`,Rs=e=>{let t=Vs(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Bs(e);let n=e.split(Fs);return zs(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Ms(i,t):t:i||Is}return n[e]||Is}}},zs=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=zs(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Fs):e.slice(t).join(Fs),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Bs=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Ls+r:void 0})(),Vs=e=>{let{theme:t,classGroups:n}=e;return Hs(n,t)},Hs=(e,t)=>{let n=Ps();for(let r in e){let i=e[r];Us(i,n,r,t)}return n},Us=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Ws(i,t,n,r)}},Ws=(e,t,n,r)=>{if(typeof e==`string`){Gs(e,t,n);return}if(typeof e==`function`){Ks(e,t,n,r);return}qs(e,t,n,r)},Gs=(e,t,n)=>{let r=e===``?t:Js(t,e);r.classGroupId=n},Ks=(e,t,n,r)=>{if(Ys(e)){Us(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Ns(n,e))},qs=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Us(o,Js(t,a),n,r)}},Js=(e,t)=>{let n=e,r=t.split(Fs),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Ps(),n.nextPart.set(t,i)),n=i}return n},Ys=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Xs=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Zs=`!`,Qs=`:`,$s=[],ec=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),tc=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Qs){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Zs)?(c=s.slice(0,-1),l=!0):s.startsWith(Zs)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return ec(t,l,c,u)};if(t){let e=t+Qs,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):ec($s,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},nc=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},rc=e=>({cache:Xs(e.cacheSize),parseClassName:tc(e),sortModifiers:nc(e),postfixLookupClassGroupIds:ic(e),...Rs(e)}),ic=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},ac=/\s+/,oc=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(ac),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+Zs:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},sc=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=cc(n))&&(i&&(i+=` `),i+=r);return i},cc=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=cc(e[r]))&&(n&&(n+=` `),n+=t);return n},lc=(e,...t)=>{let n,r,i,a,o=o=>(n=rc(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=oc(e,n);return i(e,a),a};return a=o,(...e)=>a(sc(...e))},uc=[],dc=e=>{let t=t=>t[e]||uc;return t.isThemeGetter=!0,t},fc=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,pc=/^\((?:(\w[\w-]*):)?(.+)\)$/i,mc=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,hc=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,gc=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,_c=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,vc=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,yc=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,bc=e=>mc.test(e),xc=e=>!!e&&!Number.isNaN(Number(e)),Sc=e=>!!e&&Number.isInteger(Number(e)),Cc=e=>e.endsWith(`%`)&&xc(e.slice(0,-1)),wc=e=>hc.test(e),Tc=()=>!0,Ec=e=>gc.test(e)&&!_c.test(e),Dc=()=>!1,Oc=e=>vc.test(e),kc=e=>yc.test(e),Ac=e=>!j(e)&&!M(e),jc=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Mc=e=>qc(e,Zc,Dc),j=e=>fc.test(e),Nc=e=>qc(e,Qc,Ec),Pc=e=>qc(e,$c,xc),Fc=e=>qc(e,tl,Tc),Ic=e=>qc(e,el,Dc),Lc=e=>qc(e,Yc,Dc),Rc=e=>qc(e,Xc,kc),zc=e=>qc(e,nl,Oc),M=e=>pc.test(e),Bc=e=>Jc(e,Qc),Vc=e=>Jc(e,el),Hc=e=>Jc(e,Yc),Uc=e=>Jc(e,Zc),Wc=e=>Jc(e,Xc),Gc=e=>Jc(e,nl,!0),Kc=e=>Jc(e,tl,!0),qc=(e,t,n)=>{let r=fc.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Jc=(e,t,n=!1)=>{let r=pc.exec(e);return r?r[1]?t(r[1]):n:!1},Yc=e=>e===`position`||e===`percentage`,Xc=e=>e===`image`||e===`url`,Zc=e=>e===`length`||e===`size`||e===`bg-size`,Qc=e=>e===`length`,$c=e=>e===`number`,el=e=>e===`family-name`,tl=e=>e===`number`||e===`weight`,nl=e=>e===`shadow`,rl=lc(()=>{let e=dc(`color`),t=dc(`font`),n=dc(`text`),r=dc(`font-weight`),i=dc(`tracking`),a=dc(`leading`),o=dc(`breakpoint`),s=dc(`container`),c=dc(`spacing`),l=dc(`radius`),u=dc(`shadow`),d=dc(`inset-shadow`),f=dc(`text-shadow`),p=dc(`drop-shadow`),m=dc(`blur`),h=dc(`perspective`),g=dc(`aspect`),_=dc(`ease`),v=dc(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),M,j],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[M,j,c],T=()=>[bc,`full`,`auto`,...w()],E=()=>[Sc,`none`,`subgrid`,M,j],ee=()=>[`auto`,{span:[`full`,Sc,M,j]},Sc,M,j],te=()=>[Sc,`auto`,M,j],D=()=>[`auto`,`min`,`max`,`fr`,M,j],ne=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],re=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],ie=()=>[`auto`,...w()],ae=()=>[bc,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],oe=()=>[bc,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],se=()=>[bc,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],O=()=>[e,M,j],ce=()=>[...b(),Hc,Lc,{position:[M,j]}],le=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ue=()=>[`auto`,`cover`,`contain`,Uc,Mc,{size:[M,j]}],de=()=>[Cc,Bc,Nc],fe=()=>[``,`none`,`full`,l,M,j],pe=()=>[``,xc,Bc,Nc],me=()=>[`solid`,`dashed`,`dotted`,`double`],he=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ge=()=>[xc,Cc,Hc,Lc],_e=()=>[``,`none`,m,M,j],ve=()=>[`none`,xc,M,j],ye=()=>[`none`,xc,M,j],be=()=>[xc,M,j],k=()=>[bc,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[wc],breakpoint:[wc],color:[Tc],container:[wc],"drop-shadow":[wc],ease:[`in`,`out`,`in-out`],font:[Ac],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[wc],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[wc],shadow:[wc],spacing:[`px`,xc],text:[wc],"text-shadow":[wc],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,bc,j,M,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,M,j]}],"container-named":[jc],columns:[{columns:[xc,j,M,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Sc,`auto`,M,j]}],basis:[{basis:[bc,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[xc,bc,`auto`,`initial`,`none`,j]}],grow:[{grow:[``,xc,M,j]}],shrink:[{shrink:[``,xc,M,j]}],order:[{order:[Sc,`first`,`last`,`none`,M,j]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:ee()}],"col-start":[{"col-start":te()}],"col-end":[{"col-end":te()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:ee()}],"row-start":[{"row-start":te()}],"row-end":[{"row-end":te()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":D()}],"auto-rows":[{"auto-rows":D()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...ne(),`normal`]}],"justify-items":[{"justify-items":[...re(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...re()]}],"align-content":[{content:[`normal`,...ne()]}],"align-items":[{items:[...re(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...re(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ne()}],"place-items":[{"place-items":[...re(),`baseline`]}],"place-self":[{"place-self":[`auto`,...re()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:ie()}],mx:[{mx:ie()}],my:[{my:ie()}],ms:[{ms:ie()}],me:[{me:ie()}],mbs:[{mbs:ie()}],mbe:[{mbe:ie()}],mt:[{mt:ie()}],mr:[{mr:ie()}],mb:[{mb:ie()}],ml:[{ml:ie()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:ae()}],"inline-size":[{inline:[`auto`,...oe()]}],"min-inline-size":[{"min-inline":[`auto`,...oe()]}],"max-inline-size":[{"max-inline":[`none`,...oe()]}],"block-size":[{block:[`auto`,...se()]}],"min-block-size":[{"min-block":[`auto`,...se()]}],"max-block-size":[{"max-block":[`none`,...se()]}],w:[{w:[s,`screen`,...ae()]}],"min-w":[{"min-w":[s,`screen`,`none`,...ae()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...ae()]}],h:[{h:[`screen`,`lh`,...ae()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...ae()]}],"max-h":[{"max-h":[`screen`,`lh`,...ae()]}],"font-size":[{text:[`base`,n,Bc,Nc]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Kc,Fc]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Cc,j]}],"font-family":[{font:[Vc,Ic,t]}],"font-features":[{"font-features":[j]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,M,j]}],"line-clamp":[{"line-clamp":[xc,`none`,M,Pc]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,M,j]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,M,j]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:O()}],"text-color":[{text:O()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...me(),`wavy`]}],"text-decoration-thickness":[{decoration:[xc,`from-font`,`auto`,M,Nc]}],"text-decoration-color":[{decoration:O()}],"underline-offset":[{"underline-offset":[xc,`auto`,M,j]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Sc,M,j]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,M,j]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,M,j]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ce()}],"bg-repeat":[{bg:le()}],"bg-size":[{bg:ue()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Sc,M,j],radial:[``,M,j],conic:[Sc,M,j]},Wc,Rc]}],"bg-color":[{bg:O()}],"gradient-from-pos":[{from:de()}],"gradient-via-pos":[{via:de()}],"gradient-to-pos":[{to:de()}],"gradient-from":[{from:O()}],"gradient-via":[{via:O()}],"gradient-to":[{to:O()}],rounded:[{rounded:fe()}],"rounded-s":[{"rounded-s":fe()}],"rounded-e":[{"rounded-e":fe()}],"rounded-t":[{"rounded-t":fe()}],"rounded-r":[{"rounded-r":fe()}],"rounded-b":[{"rounded-b":fe()}],"rounded-l":[{"rounded-l":fe()}],"rounded-ss":[{"rounded-ss":fe()}],"rounded-se":[{"rounded-se":fe()}],"rounded-ee":[{"rounded-ee":fe()}],"rounded-es":[{"rounded-es":fe()}],"rounded-tl":[{"rounded-tl":fe()}],"rounded-tr":[{"rounded-tr":fe()}],"rounded-br":[{"rounded-br":fe()}],"rounded-bl":[{"rounded-bl":fe()}],"border-w":[{border:pe()}],"border-w-x":[{"border-x":pe()}],"border-w-y":[{"border-y":pe()}],"border-w-s":[{"border-s":pe()}],"border-w-e":[{"border-e":pe()}],"border-w-bs":[{"border-bs":pe()}],"border-w-be":[{"border-be":pe()}],"border-w-t":[{"border-t":pe()}],"border-w-r":[{"border-r":pe()}],"border-w-b":[{"border-b":pe()}],"border-w-l":[{"border-l":pe()}],"divide-x":[{"divide-x":pe()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":pe()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...me(),`hidden`,`none`]}],"divide-style":[{divide:[...me(),`hidden`,`none`]}],"border-color":[{border:O()}],"border-color-x":[{"border-x":O()}],"border-color-y":[{"border-y":O()}],"border-color-s":[{"border-s":O()}],"border-color-e":[{"border-e":O()}],"border-color-bs":[{"border-bs":O()}],"border-color-be":[{"border-be":O()}],"border-color-t":[{"border-t":O()}],"border-color-r":[{"border-r":O()}],"border-color-b":[{"border-b":O()}],"border-color-l":[{"border-l":O()}],"divide-color":[{divide:O()}],"outline-style":[{outline:[...me(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[xc,M,j]}],"outline-w":[{outline:[``,xc,Bc,Nc]}],"outline-color":[{outline:O()}],shadow:[{shadow:[``,`none`,u,Gc,zc]}],"shadow-color":[{shadow:O()}],"inset-shadow":[{"inset-shadow":[`none`,d,Gc,zc]}],"inset-shadow-color":[{"inset-shadow":O()}],"ring-w":[{ring:pe()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:O()}],"ring-offset-w":[{"ring-offset":[xc,Nc]}],"ring-offset-color":[{"ring-offset":O()}],"inset-ring-w":[{"inset-ring":pe()}],"inset-ring-color":[{"inset-ring":O()}],"text-shadow":[{"text-shadow":[`none`,f,Gc,zc]}],"text-shadow-color":[{"text-shadow":O()}],opacity:[{opacity:[xc,M,j]}],"mix-blend":[{"mix-blend":[...he(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":he()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[xc]}],"mask-image-linear-from-pos":[{"mask-linear-from":ge()}],"mask-image-linear-to-pos":[{"mask-linear-to":ge()}],"mask-image-linear-from-color":[{"mask-linear-from":O()}],"mask-image-linear-to-color":[{"mask-linear-to":O()}],"mask-image-t-from-pos":[{"mask-t-from":ge()}],"mask-image-t-to-pos":[{"mask-t-to":ge()}],"mask-image-t-from-color":[{"mask-t-from":O()}],"mask-image-t-to-color":[{"mask-t-to":O()}],"mask-image-r-from-pos":[{"mask-r-from":ge()}],"mask-image-r-to-pos":[{"mask-r-to":ge()}],"mask-image-r-from-color":[{"mask-r-from":O()}],"mask-image-r-to-color":[{"mask-r-to":O()}],"mask-image-b-from-pos":[{"mask-b-from":ge()}],"mask-image-b-to-pos":[{"mask-b-to":ge()}],"mask-image-b-from-color":[{"mask-b-from":O()}],"mask-image-b-to-color":[{"mask-b-to":O()}],"mask-image-l-from-pos":[{"mask-l-from":ge()}],"mask-image-l-to-pos":[{"mask-l-to":ge()}],"mask-image-l-from-color":[{"mask-l-from":O()}],"mask-image-l-to-color":[{"mask-l-to":O()}],"mask-image-x-from-pos":[{"mask-x-from":ge()}],"mask-image-x-to-pos":[{"mask-x-to":ge()}],"mask-image-x-from-color":[{"mask-x-from":O()}],"mask-image-x-to-color":[{"mask-x-to":O()}],"mask-image-y-from-pos":[{"mask-y-from":ge()}],"mask-image-y-to-pos":[{"mask-y-to":ge()}],"mask-image-y-from-color":[{"mask-y-from":O()}],"mask-image-y-to-color":[{"mask-y-to":O()}],"mask-image-radial":[{"mask-radial":[M,j]}],"mask-image-radial-from-pos":[{"mask-radial-from":ge()}],"mask-image-radial-to-pos":[{"mask-radial-to":ge()}],"mask-image-radial-from-color":[{"mask-radial-from":O()}],"mask-image-radial-to-color":[{"mask-radial-to":O()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[xc]}],"mask-image-conic-from-pos":[{"mask-conic-from":ge()}],"mask-image-conic-to-pos":[{"mask-conic-to":ge()}],"mask-image-conic-from-color":[{"mask-conic-from":O()}],"mask-image-conic-to-color":[{"mask-conic-to":O()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ce()}],"mask-repeat":[{mask:le()}],"mask-size":[{mask:ue()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,M,j]}],filter:[{filter:[``,`none`,M,j]}],blur:[{blur:_e()}],brightness:[{brightness:[xc,M,j]}],contrast:[{contrast:[xc,M,j]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Gc,zc]}],"drop-shadow-color":[{"drop-shadow":O()}],grayscale:[{grayscale:[``,xc,M,j]}],"hue-rotate":[{"hue-rotate":[xc,M,j]}],invert:[{invert:[``,xc,M,j]}],saturate:[{saturate:[xc,M,j]}],sepia:[{sepia:[``,xc,M,j]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,M,j]}],"backdrop-blur":[{"backdrop-blur":_e()}],"backdrop-brightness":[{"backdrop-brightness":[xc,M,j]}],"backdrop-contrast":[{"backdrop-contrast":[xc,M,j]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,xc,M,j]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[xc,M,j]}],"backdrop-invert":[{"backdrop-invert":[``,xc,M,j]}],"backdrop-opacity":[{"backdrop-opacity":[xc,M,j]}],"backdrop-saturate":[{"backdrop-saturate":[xc,M,j]}],"backdrop-sepia":[{"backdrop-sepia":[``,xc,M,j]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,M,j]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[xc,`initial`,M,j]}],ease:[{ease:[`linear`,`initial`,_,M,j]}],delay:[{delay:[xc,M,j]}],animate:[{animate:[`none`,v,M,j]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,M,j]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ve()}],"rotate-x":[{"rotate-x":ve()}],"rotate-y":[{"rotate-y":ve()}],"rotate-z":[{"rotate-z":ve()}],scale:[{scale:ye()}],"scale-x":[{"scale-x":ye()}],"scale-y":[{"scale-y":ye()}],"scale-z":[{"scale-z":ye()}],"scale-3d":[`scale-3d`],skew:[{skew:be()}],"skew-x":[{"skew-x":be()}],"skew-y":[{"skew-y":be()}],transform:[{transform:[M,j,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:k()}],"translate-x":[{"translate-x":k()}],"translate-y":[{"translate-y":k()}],"translate-z":[{"translate-z":k()}],"translate-none":[`translate-none`],zoom:[{zoom:[Sc,M,j]}],accent:[{accent:O()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:O()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,M,j]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":O()}],"scrollbar-track-color":[{"scrollbar-track":O()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,M,j]}],fill:[{fill:[`none`,...O()]}],"stroke-w":[{stroke:[xc,Bc,Nc,Pc]}],stroke:[{stroke:[`none`,...O()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function il(...e){return rl(g(e))}var al=Zn(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}}),ol=u.forwardRef(function({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i},a){return(0,m.jsx)(r?nr:`button`,{ref:a,"data-slot":`button`,"data-variant":t,"data-size":n,className:il(al({variant:t,size:n,className:e})),...i})});function sl({...e}){return(0,m.jsx)(so,{"data-slot":`dialog`,...e})}u.forwardRef(function({...e},t){return(0,m.jsx)(co,{ref:t,"data-slot":`dialog-trigger`,...e})});function cl({container:e,...t}){return(0,m.jsx)(lo,{"data-slot":`dialog-portal`,container:e??void 0,...t})}u.forwardRef(function({...e},t){return(0,m.jsx)(ho,{ref:t,"data-slot":`dialog-close`,...e})});var ll=u.forwardRef(function({className:e,...t},n){return(0,m.jsx)(uo,{ref:n,"data-slot":`dialog-overlay`,className:il(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}),ul=u.forwardRef(function({container:e,className:t,children:n,showCloseButton:r=!0,...i},a){return(0,m.jsxs)(cl,{container:e,children:[(0,m.jsx)(ll,{}),(0,m.jsxs)(fo,{ref:a,"data-slot":`dialog-content`,className:il(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,t),...i,children:[n,r&&(0,m.jsx)(ho,{"data-slot":`dialog-close`,asChild:!0,children:(0,m.jsxs)(ol,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`,children:[(0,m.jsx)(it,{}),(0,m.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})]})});function dl({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`dialog-header`,className:il(`flex flex-col gap-2`,e),...t})}function fl({className:e,showCloseButton:t=!1,children:n,...r}){return(0,m.jsxs)(`div`,{"data-slot":`dialog-footer`,className:il(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,m.jsx)(ho,{asChild:!0,children:(0,m.jsx)(ol,{variant:`outline`,children:`Close`})})]})}var pl=u.forwardRef(function({className:e,...t},n){return(0,m.jsx)(po,{ref:n,"data-slot":`dialog-title`,className:il(`text-base leading-none font-medium`,e),...t})}),ml=u.forwardRef(function({className:e,...t},n){return(0,m.jsx)(mo,{ref:n,"data-slot":`dialog-description`,className:il(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}),hl=5*1024*1024,gl=`zt-md-image-upload-file-input`,_l=e=>new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{let e=r.result;if(typeof e==`string`){t(e);return}n(Error(`Invalid file result`))},r.onerror=()=>{n(r.error??Error(`File read failed`))},r.readAsDataURL(e)}),vl=e=>e<1024*1024?`${Math.ceil(e/1024)}KB`:`${(e/1024/1024).toFixed(1)}MB`,yl=e=>{try{let t=new URL(e);return!!(t.protocol&&t.host)}catch{return!1}},bl=e=>new Promise((t,n)=>{let r=new Image;r.onload=()=>{t()},r.onerror=()=>{n(Error(`Image load failed`))},r.src=e}),xl=({messages:e,portalContainer:t,imageUpload:n,onConfirm:r,onCancel:i})=>{let[a,o]=(0,u.useState)(`file`),[s,c]=(0,u.useState)(null),[l,d]=(0,u.useState)(``),[f,p]=(0,u.useState)(!1),[h,g]=(0,u.useState)(``),[_,v]=(0,u.useState)(!1),[y,b]=(0,u.useState)(!1),[x,S]=(0,u.useState)(!1),C=(0,u.useRef)(null),w=(0,u.useRef)(null),T=(0,u.useRef)(!0),E=n?.maxFileSize??hl,ee=_||y,te=a===`file`&&(ee||!!l),D=a===`file`&&!!l&&!ee,ne=!l||!!h||ee||f,re=(0,u.useCallback)(async t=>{if(!t.type.startsWith(`image/`)){c(null),d(``),g(e.imageUploadInvalidType);return}if(t.size>E){c(null),d(``),g(e.imageUploadFileSizeExceeded.replace(`{size}`,vl(E)));return}g(``),c(t),p(!1),v(!0);try{let r=n?.upload?await n.upload(t):await _l(t);if(!T.current)return;if(!r){d(``),g(e.imageUploadFailed);return}d(r)}catch(t){if(!T.current)return;let r=n?.upload?t instanceof Error?t.message:e.imageUploadFailed:e.imageUploadFileReadFailed;d(``),g(r||e.imageUploadFailed)}finally{T.current&&v(!1)}},[n,E,e]),ie=(0,u.useCallback)(()=>{let e=C.current?.files?.[0];e&&(re(e),C.current.value=``)},[re]),ae=(0,u.useCallback)(t=>{if(c(null),p(!1),d(t),!t){g(``);return}g(yl(t)?``:e.imageUploadInvalidUrl)},[e.imageUploadInvalidUrl]),oe=(0,u.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),!ee&&(e.dataTransfer.dropEffect=`copy`,S(!0))},[ee]),se=(0,u.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),e.currentTarget.contains(e.relatedTarget)||S(!1)},[]),O=(0,u.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),S(!1),ee)return;let t=e.dataTransfer.files?.[0];t&&re(t)},[ee,re]),ce=(0,u.useCallback)(e=>{ee||(o(e),c(null),d(``),p(!1),g(``))},[ee]),le=(0,u.useCallback)(async()=>{if(ee){g(e.imageUploadUploadingWait);return}if(!l){g(e.imageUploadSelectOrEnterImage);return}if(a===`url`&&!yl(l)){g(e.imageUploadInvalidUrl);return}g(``),b(!0);try{if(await bl(l),!T.current)return;r({src:l,alt:a===`file`?s?.name??``:``})}catch{T.current&&(p(!0),g(e.imageUploadLoadFailed))}finally{T.current&&b(!1)}},[l,ee,e.imageUploadInvalidUrl,e.imageUploadLoadFailed,e.imageUploadSelectOrEnterImage,e.imageUploadUploadingWait,r,s,a]),ue=(0,u.useCallback)(e=>{e.key===`Enter`&&!e.shiftKey&&a===`url`&&(e.preventDefault(),le())},[le,a]);return(0,u.useEffect)(()=>(T.current=!0,()=>{T.current=!1}),[]),(0,u.useEffect)(()=>{a===`url`&&w.current?.focus()},[a]),(0,m.jsx)(sl,{open:!0,onOpenChange:e=>!e&&i(),children:(0,m.jsxs)(ul,{container:t,className:`zt-md-image-upload-content-shell max-w-2xl sm:!max-w-2xl max-h-[90vh] overflow-hidden flex flex-col`,showCloseButton:!1,onCloseAutoFocus:e=>e.preventDefault(),onMouseDown:e=>e.stopPropagation(),onKeyDown:ue,children:[(0,m.jsxs)(dl,{children:[(0,m.jsx)(pl,{children:e.imageUploadDialogTitle}),(0,m.jsx)(ml,{className:`sr-only`,children:`${e.imageUploadFileTab},${e.imageUploadUrlTab}`})]}),(0,m.jsxs)(`div`,{className:`zt-md-image-upload-segmented`,role:`tablist`,"aria-label":e.imageUploadDialogTitle,children:[(0,m.jsx)(ol,{type:`button`,variant:`ghost`,className:`zt-md-image-upload-segment`,"data-active":a===`file`?`true`:`false`,disabled:ee,onClick:()=>ce(`file`),children:e.imageUploadFileTab}),(0,m.jsx)(ol,{type:`button`,variant:`ghost`,className:`zt-md-image-upload-segment`,"data-active":a===`url`?`true`:`false`,disabled:ee,onClick:()=>ce(`url`),children:e.imageUploadUrlTab})]}),(0,m.jsxs)(`div`,{className:`zt-md-image-upload-content`,children:[a===`file`?(0,m.jsxs)(`div`,{className:`zt-md-image-upload-file`,children:[(0,m.jsx)(`input`,{ref:C,id:gl,type:`file`,accept:`image/*`,className:`zt-md-image-upload-file-input`,disabled:ee,onChange:ie}),(0,m.jsx)(`label`,{htmlFor:gl,className:`zt-md-image-upload-file-label`,"data-drag-over":x?`true`:`false`,"data-has-preview":l?`true`:`false`,"data-disabled":ee?`true`:`false`,"aria-disabled":ee,onClick:e=>{ee&&e.preventDefault()},onDragOver:oe,onDragLeave:se,onDrop:O,children:_?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`div`,{className:`zt-md-image-upload-file-icon`,children:(0,m.jsx)(Ge,{size:40,className:`zt-md-image-upload-spin`})}),(0,m.jsx)(`div`,{className:`zt-md-image-upload-file-text`,children:e.imageUploadUploadingLabel})]}):l?(0,m.jsx)(`div`,{className:`zt-md-image-upload-file-preview`,children:f?(0,m.jsxs)(`div`,{className:`zt-md-image-upload-preview-error`,children:[(0,m.jsx)(Ie,{size:40}),(0,m.jsx)(`span`,{children:e.imageUploadLoadFailed})]}):(0,m.jsx)(`img`,{src:l,alt:``,onLoad:()=>p(!1),onError:()=>p(!0)})}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`div`,{className:`zt-md-image-upload-file-icon`,children:(0,m.jsx)(Le,{size:40})}),(0,m.jsx)(`div`,{className:`zt-md-image-upload-file-text`,children:e.imageUploadDropLabel}),(0,m.jsx)(`div`,{className:`zt-md-image-upload-file-hint`,children:e.imageUploadSupportsAndMax.replace(`{size}`,vl(E))})]})}),te?(0,m.jsx)(`div`,{className:`zt-md-image-upload-file-hint zt-md-image-upload-reselect-hint`,"data-placeholder":D?`false`:`true`,children:e.imageUploadReselectHint}):null]}):(0,m.jsxs)(`div`,{className:`zt-md-image-upload-url`,children:[(0,m.jsx)(`label`,{className:`zt-md-image-upload-label`,htmlFor:`zt-md-image-upload-url-input`,children:e.imageUploadUrlTab}),(0,m.jsx)(`input`,{ref:w,id:`zt-md-image-upload-url-input`,type:`url`,className:`zt-md-image-upload-url-input`,placeholder:e.imageUploadUrlPlaceholder,value:l,disabled:ee,onChange:e=>ae(e.target.value)}),l&&!h?(0,m.jsx)(`div`,{className:`zt-md-image-upload-url-preview`,children:f?(0,m.jsxs)(`div`,{className:`zt-md-image-upload-preview-error`,children:[(0,m.jsx)(Ie,{size:32}),(0,m.jsx)(`span`,{children:e.imageUploadLoadFailed})]}):(0,m.jsx)(`img`,{src:l,alt:``,onLoad:()=>p(!1),onError:()=>p(!0)})}):null]}),h?(0,m.jsxs)(`div`,{className:`zt-md-image-upload-error`,role:`alert`,"aria-live":`polite`,children:[(0,m.jsx)(we,{size:16,className:`zt-md-image-upload-error-icon`}),(0,m.jsx)(`span`,{children:h})]}):null]}),(0,m.jsxs)(fl,{children:[(0,m.jsx)(ol,{type:`button`,variant:`outline`,onClick:i,children:e.imageUploadCancelLabel}),(0,m.jsx)(ol,{type:`button`,disabled:ne,onClick:()=>{le()},children:ee?e.imageUploadUploadingLabel:e.imageUploadConfirmLabel})]})]})})},Sl=(e,t)=>{let n=e?.state?.schema?.nodes?.paragraph;return n?t?n.create(null,t):n.createAndFill():null},Cl=(e,t)=>{let n=e?.state?.schema?.nodes?.image;return n?n.create(t):null},wl=e=>{let t=e?.state?.selection;if(!t)return!1;let n=t.$to.parent;if(t.$to.parentOffset<n.content.size)return!0;if(t.$to.depth<1)return!1;let r=t.$to.node(t.$to.depth-1);return t.$to.index(t.$to.depth-1)<r.childCount-1},Tl=(e,t)=>{let n=[t,t-1,t+1];for(let t of n)if(!(t<0||t>e.content.size)&&e.nodeAt(t)?.type?.name===`image`)return t;return null},El=(e,n)=>{let r=e.selection.from-n,i=Tl(e.doc,r);return i===null?null:t.r.create(e.doc,i)},Dl=(e,t)=>{if(!e?.state||!e?.dispatch)return!1;let n=Cl(e,t);if(!n)return!1;let r=wl(e),i=e.state.tr.replaceSelectionWith(n),a=i.selection.to;if(!r){let t=Sl(e);t&&i.insert(a,t)}let o=El(i,n.nodeSize);return o?(i.setSelection(o).scrollIntoView(),e.dispatch(i),!0):!1},Ol=e=>{let t=e.portalContainer.closest(`.zt-md`)?.classList.contains(`zt-md-dark`)?`zt-md-dark`:`zt-md-light`,n=document.createElement(`div`);n.className=`zt-md-image-upload-host ${t}`,document.body.appendChild(n);let r=(0,f.createRoot)(n),i=e=>{queueMicrotask(()=>{r.unmount(),n.remove(),e?.()})};r.render((0,u.createElement)(xl,{messages:e.messages,portalContainer:n,imageUpload:e.imageUpload,onConfirm:t=>{let n=Dl(e.view,{src:t.src,alt:t.alt,title:``});i(()=>{n&&e.view?.focus?.()})},onCancel:()=>{i(()=>{e.view?.focus?.()})}}))},kl=`math_block`,Al=`Backspace`,jl=e=>e.key!==Al||e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey,Ml=e=>{if(e.parent.type.name!==`paragraph`||e.parentOffset!==0||e.depth<1)return null;let t=e.index(e.depth-1);if(t<=0)return null;let n=e.node(e.depth-1).child(t-1);return n.type.name===kl?{previousBlock:n,previousBlockStart:e.before(e.depth)-n.nodeSize}:null},Nl=(e,n)=>{let{selection:r}=e.state;if(!r.empty)return!1;let i=r.$from,a=Ml(i);if(!a)return!1;let o=i.parent.textContent.length===0,s=i.before(i.depth),c=s+i.parent.nodeSize;n.preventDefault();let l=e.state.tr;return o&&l.delete(s,c),l.setSelection(t.r.create(l.doc,a.previousBlockStart)).scrollIntoView(),e.dispatch(l),!0},Pl=r.u(()=>new t.i({key:new t.a(`zt-md-math-backspace-entry`),props:{handleKeyDown:(e,t)=>jl(t)?!1:Nl(e,t)}})),N=class e extends Error{constructor(t,n){var r=`KaTeX parse error: `+t,i,a,o=n&&n.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?r+=` at end of input: `:r+=` at position `+(i+1)+`: `;var c=s.slice(i,a).replace(/[^]/g,`$&̲`),l=i>15?`…`+s.slice(i-15,i):s.slice(0,i),u=a+15<s.length?s.slice(a,a+15)+`…`:s.slice(a);r+=l+c+u}super(r),this.name=`ParseError`,this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,e.prototype),this.position=i,i!=null&&a!=null&&(this.length=a-i),this.rawMessage=t}},Fl=/([A-Z])/g,Il=e=>e.replace(Fl,`-$1`).toLowerCase(),Ll={"&":`&`,">":`>`,"<":`<`,'"':`"`,"'":`'`},Rl=/[&><"']/g,zl=e=>String(e).replace(Rl,e=>Ll[e]),Bl=e=>e.type===`ordgroup`||e.type===`color`?e.body.length===1?Bl(e.body[0]):e:e.type===`font`?Bl(e.body):e,Vl=new Set([`mathord`,`textord`,`atom`]),Hl=e=>Vl.has(Bl(e).type),Ul=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?t[2]!==`:`||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():`_relative`},Wl={displayMode:{type:`boolean`,description:`Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.`,cli:`-d, --display-mode`},output:{type:{enum:[`htmlAndMathml`,`html`,`mathml`]},description:`Determines the markup language of the output.`,cli:`-F, --format <type>`},leqno:{type:`boolean`,description:`Render display math in leqno style (left-justified tags).`},fleqn:{type:`boolean`,description:`Render display math flush left.`},throwOnError:{type:`boolean`,default:!0,cli:`-t, --no-throw-on-error`,cliDescription:`Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error.`},errorColor:{type:`string`,default:`#cc0000`,cli:`-c, --error-color <color>`,cliDescription:`A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.`,cliProcessor:e=>`#`+e},macros:{type:`object`,cli:`-m, --macro <def>`,cliDescription:`Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).`,cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:`number`,description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:`--min-rule-thickness <size>`,cliProcessor:parseFloat},colorIsTextColor:{type:`boolean`,description:`Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.`,cli:`-b, --color-is-text-color`},strict:{type:[{enum:[`warn`,`ignore`,`error`]},`boolean`,`function`],description:`Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.`,cli:`-S, --strict`,cliDefault:!1},trust:{type:[`boolean`,`function`],description:`Trust the input, enabling all HTML features such as \\url.`,cli:`-T, --trust`},maxSize:{type:`number`,default:1/0,description:`If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large`,processor:e=>Math.max(0,e),cli:`-s, --max-size <n>`,cliProcessor:parseInt},maxExpand:{type:`number`,default:1e3,description:`Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.`,processor:e=>Math.max(0,e),cli:`-e, --max-expand <n>`,cliProcessor:e=>e===`Infinity`?1/0:parseInt(e)},globalGroup:{type:`boolean`,cli:!1}};function Gl(e){if(typeof e!=`string`)return e.enum[0];switch(e){case`boolean`:return!1;case`string`:return``;case`number`:return 0;case`object`:return{};default:throw Error(`Unexpected schema type; settings must declare an explicit default.`)}}function Kl(e){return e.default===void 0?Gl(Array.isArray(e.type)?e.type[0]:e.type):e.default}function ql(e,t,n,r){var i=n[t];e[t]=i===void 0?Kl(r):r.processor?r.processor(i):i}var Jl=class{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e||={};for(var t of Object.keys(Wl)){var n=Wl[t];n&&ql(this,t,e,n)}}reportNonstrict(e,t,n){var r=this.strict;if(typeof r==`function`&&(r=r(e,t,n)),!(!r||r===`ignore`)){if(r===!0||r===`error`)throw new N(`LaTeX-incompatible input and strict mode is set to 'error': `+(t+` [`+e+`]`),n);r===`warn`?typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)):typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`))}}useStrictBehavior(e,t,n){var r=this.strict;if(typeof r==`function`)try{r=r(e,t,n)}catch{r=`error`}return!r||r===`ignore`?!1:r===!0||r===`error`?!0:r===`warn`?(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)),!1):(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`)),!1)}isTrusted(e){if(`url`in e&&e.url&&!e.protocol){var t=Ul(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},Yl=class{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return iu[au[this.id]]}sub(){return iu[ou[this.id]]}fracNum(){return iu[su[this.id]]}fracDen(){return iu[cu[this.id]]}cramp(){return iu[lu[this.id]]}text(){return iu[uu[this.id]]}isTight(){return this.size>=2}},Xl=0,Zl=1,Ql=2,$l=3,eu=4,tu=5,nu=6,ru=7,iu=[new Yl(Xl,0,!1),new Yl(Zl,0,!0),new Yl(Ql,1,!1),new Yl($l,1,!0),new Yl(eu,2,!1),new Yl(tu,2,!0),new Yl(nu,3,!1),new Yl(ru,3,!0)],au=[eu,tu,eu,tu,nu,ru,nu,ru],ou=[tu,tu,tu,tu,ru,ru,ru,ru],su=[Ql,$l,eu,tu,nu,ru,nu,ru],cu=[$l,$l,tu,tu,ru,ru,ru,ru],lu=[Zl,Zl,$l,$l,tu,tu,ru,ru],uu=[Xl,Zl,Ql,$l,Ql,$l,Ql,$l],P={DISPLAY:iu[Xl],TEXT:iu[Ql],SCRIPT:iu[eu],SCRIPTSCRIPT:iu[nu]},du=[{name:`latin`,blocks:[[256,591],[768,879]]},{name:`cyrillic`,blocks:[[1024,1279]]},{name:`armenian`,blocks:[[1328,1423]]},{name:`brahmic`,blocks:[[2304,4255]]},{name:`georgian`,blocks:[[4256,4351]]},{name:`cjk`,blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:`hangul`,blocks:[[44032,55215]]}];function fu(e){for(var t=0;t<du.length;t++)for(var n=du[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}var pu=[];du.forEach(e=>e.blocks.forEach(e=>pu.push(...e)));function mu(e){for(var t=0;t<pu.length;t+=2)if(e>=pu[t]&&e<=pu[t+1])return!0;return!1}var hu=e=>e+` `+e,gu=80,_u=function(e,t){return`M95,`+(622+e+t)+`
|
|
97
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return d.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},nM=`DialogDescriptionWarning`,rM=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${eM(nM).contentName}}.`;return d.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},iM=kj,aM=jj,oM=Fj,sM=Lj,cM=Vj,lM=Kj,uM=Jj,dM=Xj;function fM(e){let[t,n]=d.useState(void 0);return dk(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var pM=[`top`,`right`,`bottom`,`left`],mM=Math.min,hM=Math.max,gM=Math.round,_M=Math.floor,vM=e=>({x:e,y:e}),yM={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function bM(e,t,n){return hM(e,mM(t,n))}function xM(e,t){return typeof e==`function`?e(t):e}function SM(e){return e.split(`-`)[0]}function CM(e){return e.split(`-`)[1]}function wM(e){return e===`x`?`y`:`x`}function TM(e){return e===`y`?`height`:`width`}function EM(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function DM(e){return wM(EM(e))}function OM(e,t,n){n===void 0&&(n=!1);let r=CM(e),i=DM(e),a=TM(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=LM(o)),[o,LM(o)]}function kM(e){let t=LM(e);return[AM(e),t,AM(t)]}function AM(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var jM=[`left`,`right`],MM=[`right`,`left`],NM=[`top`,`bottom`],PM=[`bottom`,`top`];function FM(e,t,n){switch(e){case`top`:case`bottom`:return n?t?MM:jM:t?jM:MM;case`left`:case`right`:return t?NM:PM;default:return[]}}function IM(e,t,n,r){let i=CM(e),a=FM(SM(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(AM)))),a}function LM(e){let t=SM(e);return yM[t]+e.slice(t.length)}function RM(e){return{top:0,right:0,bottom:0,left:0,...e}}function zM(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:RM(e)}function BM(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function VM(e,t,n){let{reference:r,floating:i}=e,a=EM(t),o=DM(t),s=TM(o),c=SM(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(CM(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function HM(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=xM(t,e),p=zM(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=BM(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=BM(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var UM=50,WM=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:HM},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=VM(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<UM&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=VM(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},GM=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=xM(e,t)||{};if(l==null)return{};let d=zM(u),f={x:n,y:r},p=DM(i),m=TM(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=mM(d[_],T),D=mM(d[v],T),ee=E,te=C-h[m]-D,ne=C/2-h[m]/2+w,re=bM(ee,ne,te),ie=!c.arrow&&CM(i)!=null&&ne!==re&&a.reference[m]/2-(ne<ee?E:D)-h[m]/2<0,ae=ie?ne<ee?ne-ee:ne-te:0;return{[p]:f[p]+ae,data:{[p]:re,centerOffset:ne-re-ae,...ie&&{alignmentOffset:ae}},reset:ie}}}),KM=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=xM(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=SM(r),_=EM(o),v=SM(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[LM(o)]:kM(o)),x=p!==`none`;!d&&x&&b.push(...IM(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=OM(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==EM(t))||T.every(e=>EM(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=EM(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function qM(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function JM(e){return pM.some(t=>e[t]>=0)}var YM=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=xM(e,t);switch(i){case`referenceHidden`:{let e=qM(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:JM(e)}}}case`escaped`:{let e=qM(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:JM(e)}}}default:return{}}}}},XM=new Set([`left`,`top`]);async function ZM(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=SM(n),s=CM(n),c=EM(n)===`y`,l=XM.has(o)?-1:1,u=a&&c?-1:1,d=xM(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var QM=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await ZM(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},$M=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=xM(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=EM(SM(i)),p=wM(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=bM(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=bM(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},eN=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=xM(e,t),u={x:n,y:r},d=EM(i),f=wM(d),p=u[f],m=u[d],h=xM(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=XM.has(SM(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},tN=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=xM(e,t),u=await o.detectOverflow(t,l),d=SM(i),f=CM(i),p=EM(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=mM(h-u[g],v),x=mM(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=hM(u.left,0),t=hM(u.right,0),n=hM(u.top,0),r=hM(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:hM(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:hM(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function nN(){return typeof window<`u`}function rN(e){return oN(e)?(e.nodeName||``).toLowerCase():`#document`}function iN(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function aN(e){return((oN(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function oN(e){return nN()?e instanceof Node||e instanceof iN(e).Node:!1}function sN(e){return nN()?e instanceof Element||e instanceof iN(e).Element:!1}function cN(e){return nN()?e instanceof HTMLElement||e instanceof iN(e).HTMLElement:!1}function lN(e){return!nN()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof iN(e).ShadowRoot}function uN(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=xN(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function dN(e){return/^(table|td|th)$/.test(rN(e))}function fN(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var pN=/transform|translate|scale|rotate|perspective|filter/,mN=/paint|layout|strict|content/,hN=e=>!!e&&e!==`none`,gN;function _N(e){let t=sN(e)?xN(e):e;return hN(t.transform)||hN(t.translate)||hN(t.scale)||hN(t.rotate)||hN(t.perspective)||!yN()&&(hN(t.backdropFilter)||hN(t.filter))||pN.test(t.willChange||``)||mN.test(t.contain||``)}function vN(e){let t=CN(e);for(;cN(t)&&!bN(t);){if(_N(t))return t;if(fN(t))return null;t=CN(t)}return null}function yN(){return gN??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),gN}function bN(e){return/^(html|body|#document)$/.test(rN(e))}function xN(e){return iN(e).getComputedStyle(e)}function SN(e){return sN(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function CN(e){if(rN(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||lN(e)&&e.host||aN(e);return lN(t)?t.host:t}function wN(e){let t=CN(e);return bN(t)?e.ownerDocument?e.ownerDocument.body:e.body:cN(t)&&uN(t)?t:wN(t)}function TN(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=wN(e),i=r===e.ownerDocument?.body,a=iN(r);if(i){let e=EN(a);return t.concat(a,a.visualViewport||[],uN(r)?r:[],e&&n?TN(e):[])}else return t.concat(r,TN(r,[],n))}function EN(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function DN(e){let t=xN(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=cN(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=gM(n)!==a||gM(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ON(e){return sN(e)?e:e.contextElement}function kN(e){let t=ON(e);if(!cN(t))return vM(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=DN(t),o=(a?gM(n.width):n.width)/r,s=(a?gM(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var AN=vM(0);function jN(e){let t=iN(e);return!yN()||!t.visualViewport?AN:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function MN(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==iN(e)?!1:t}function NN(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=ON(e),o=vM(1);t&&(r?sN(r)&&(o=kN(r)):o=kN(e));let s=MN(a,n,r)?jN(a):vM(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=iN(a),t=r&&sN(r)?iN(r):r,n=e,i=EN(n);for(;i&&r&&t!==n;){let e=kN(i),t=i.getBoundingClientRect(),r=xN(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=iN(i),i=EN(n)}}return BM({width:u,height:d,x:c,y:l})}function PN(e,t){let n=SN(e).scrollLeft;return t?t.left+n:NN(aN(e)).left+n}function FN(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-PN(e,n),y:n.top+t.scrollTop}}function IN(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=aN(r),s=t?fN(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=vM(1),u=vM(0),d=cN(r);if((d||!d&&!a)&&((rN(r)!==`body`||uN(o))&&(c=SN(r)),d)){let e=NN(r);l=kN(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?FN(o,c):vM(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function LN(e){return Array.from(e.getClientRects())}function RN(e){let t=aN(e),n=SN(e),r=e.ownerDocument.body,i=hM(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=hM(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+PN(e),s=-n.scrollTop;return xN(r).direction===`rtl`&&(o+=hM(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var zN=25;function BN(e,t){let n=iN(e),r=aN(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=yN();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=PN(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=zN&&(a-=o)}else l<=zN&&(a+=l);return{width:a,height:o,x:s,y:c}}function VN(e,t){let n=NN(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=cN(e)?kN(e):vM(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function HN(e,t,n){let r;if(t===`viewport`)r=BN(e,n);else if(t===`document`)r=RN(aN(e));else if(sN(t))r=VN(t,n);else{let n=jN(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return BM(r)}function UN(e,t){let n=CN(e);return n===t||!sN(n)||bN(n)?!1:xN(n).position===`fixed`||UN(n,t)}function WN(e,t){let n=t.get(e);if(n)return n;let r=TN(e,[],!1).filter(e=>sN(e)&&rN(e)!==`body`),i=null,a=xN(e).position===`fixed`,o=a?CN(e):e;for(;sN(o)&&!bN(o);){let t=xN(o),n=_N(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||uN(o)&&!n&&UN(e,o))?r=r.filter(e=>e!==o):i=t,o=CN(o)}return t.set(e,r),r}function GN(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?fN(t)?[]:WN(t,this._c):[].concat(n),r],o=HN(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=HN(t,a[e],i);s=hM(n.top,s),c=mM(n.right,c),l=mM(n.bottom,l),u=hM(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function KN(e){let{width:t,height:n}=DN(e);return{width:t,height:n}}function qN(e,t,n){let r=cN(t),i=aN(t),a=n===`fixed`,o=NN(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=vM(0);function l(){c.x=PN(i)}if(r||!r&&!a)if((rN(t)!==`body`||uN(i))&&(s=SN(t)),r){let e=NN(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?FN(i,s):vM(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function JN(e){return xN(e).position===`static`}function YN(e,t){if(!cN(e)||xN(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return aN(e)===n&&(n=n.ownerDocument.body),n}function XN(e,t){let n=iN(e);if(fN(e))return n;if(!cN(e)){let t=CN(e);for(;t&&!bN(t);){if(sN(t)&&!JN(t))return t;t=CN(t)}return n}let r=YN(e,t);for(;r&&dN(r)&&JN(r);)r=YN(r,t);return r&&bN(r)&&JN(r)&&!_N(r)?n:r||vN(e)||n}var ZN=async function(e){let t=this.getOffsetParent||XN,n=this.getDimensions,r=await n(e.floating);return{reference:qN(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function QN(e){return xN(e).direction===`rtl`}var $N={convertOffsetParentRelativeRectToViewportRelativeRect:IN,getDocumentElement:aN,getClippingRect:GN,getOffsetParent:XN,getElementRects:ZN,getClientRects:LN,getDimensions:KN,getScale:kN,isElement:sN,isRTL:QN};function eP(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function tP(e,t){let n=null,r,i=aN(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=_M(d),h=_M(i.clientWidth-(u+f)),g=_M(i.clientHeight-(d+p)),_=_M(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:hM(0,mM(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!eP(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function nP(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=ON(e),u=i||a?[...l?TN(l):[],...t?TN(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?tP(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?NN(e):null;c&&g();function g(){let t=NN(e);h&&!eP(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var rP=QM,iP=$M,aP=KM,oP=tN,sP=YM,cP=GM,lP=eN,uP=(e,t,n)=>{let r=new Map,i={platform:$N,...n},a={...i.platform,_c:r};return WM(e,t,{...i,platform:a})},dP=typeof document<`u`?d.useLayoutEffect:function(){};function fP(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!fP(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!fP(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function pP(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function mP(e,t){let n=pP(e);return Math.round(t*n)/n}function hP(e){let t=d.useRef(e);return dP(()=>{t.current=e}),t}function gP(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,f]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=d.useState(r);fP(p,r)||h(r);let[g,_]=d.useState(null),[v,y]=d.useState(null),b=d.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=d.useCallback(e=>{e!==T.current&&(T.current=e,y(e))},[]),S=a||g,C=o||v,w=d.useRef(null),T=d.useRef(null),E=d.useRef(u),D=c!=null,ee=hP(c),te=hP(i),ne=hP(l),re=d.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:p};te.current&&(e.platform=te.current),uP(w.current,T.current,e).then(e=>{let t={...e,isPositioned:ne.current!==!1};ie.current&&!fP(E.current,t)&&(E.current=t,m.flushSync(()=>{f(t)}))})},[p,t,n,te,ne]);dP(()=>{l===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[l]);let ie=d.useRef(!1);dP(()=>(ie.current=!0,()=>{ie.current=!1}),[]),dP(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(ee.current)return ee.current(S,C,re);re()}},[S,C,re,ee,D]);let ae=d.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),oe=d.useMemo(()=>({reference:S,floating:C}),[S,C]),se=d.useMemo(()=>{let e={position:n,left:0,top:0};if(!oe.floating)return e;let t=mP(oe.floating,u.x),r=mP(oe.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...pP(oe.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,oe.floating,u.x,u.y]);return d.useMemo(()=>({...u,update:re,refs:ae,elements:oe,floatingStyles:se}),[u,re,ae,oe,se])}var _P=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:cP({element:r.current,padding:i}).fn(n):r?cP({element:r,padding:i}).fn(n):{}}}},vP=(e,t)=>{let n=rP(e);return{name:n.name,fn:n.fn,options:[e,t]}},yP=(e,t)=>{let n=iP(e);return{name:n.name,fn:n.fn,options:[e,t]}},bP=(e,t)=>({fn:lP(e).fn,options:[e,t]}),xP=(e,t)=>{let n=aP(e);return{name:n.name,fn:n.fn,options:[e,t]}},SP=(e,t)=>{let n=oP(e);return{name:n.name,fn:n.fn,options:[e,t]}},CP=(e,t)=>{let n=sP(e);return{name:n.name,fn:n.fn,options:[e,t]}},wP=(e,t)=>{let n=_P(e);return{name:n.name,fn:n.fn,options:[e,t]}},TP=`Arrow`,EP=d.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,h.jsx)(ak.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,h.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});EP.displayName=TP;var DP=EP,OP=`Popper`,[kP,AP]=ck(OP),[jP,MP]=kP(OP),NP=e=>{let{__scopePopper:t,children:n}=e,[r,i]=d.useState(null);return(0,h.jsx)(jP,{scope:t,anchor:r,onAnchorChange:i,children:n})};NP.displayName=OP;var PP=`PopperAnchor`,FP=d.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=MP(PP,n),o=d.useRef(null),s=ZO(t,o),c=d.useRef(null);return d.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,h.jsx)(ak.div,{...i,ref:s})});FP.displayName=PP;var IP=`PopperContent`,[LP,RP]=kP(IP),zP=d.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:f=`partial`,hideWhenDetached:p=!1,updatePositionStrategy:m=`optimized`,onPlaced:g,..._}=e,v=MP(IP,n),[y,b]=d.useState(null),x=ZO(t,e=>b(e)),[S,C]=d.useState(null),w=fM(S),T=w?.width??0,E=w?.height??0,D=r+(a===`center`?``:`-`+a),ee=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},te=Array.isArray(l)?l:[l],ne=te.length>0,re={padding:ee,boundary:te.filter(UP),altBoundary:ne},{refs:ie,floatingStyles:ae,placement:oe,isPositioned:se,middlewareData:O}=gP({strategy:`fixed`,placement:D,whileElementsMounted:(...e)=>nP(...e,{animationFrame:m===`always`}),elements:{reference:v.anchor},middleware:[vP({mainAxis:i+E,alignmentAxis:o}),c&&yP({mainAxis:!0,crossAxis:!1,limiter:f===`partial`?bP():void 0,...re}),c&&xP({...re}),SP({...re,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),S&&wP({element:S,padding:s}),WP({arrowWidth:T,arrowHeight:E}),p&&CP({strategy:`referenceHidden`,...re})]}),[ce,le]=GP(oe),ue=wk(g);dk(()=>{se&&ue?.()},[se,ue]);let de=O.arrow?.x,fe=O.arrow?.y,pe=O.arrow?.centerOffset!==0,[me,he]=d.useState();return dk(()=>{y&&he(window.getComputedStyle(y).zIndex)},[y]),(0,h.jsx)(`div`,{ref:ie.setFloating,"data-radix-popper-content-wrapper":``,style:{...ae,transform:se?ae.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:me,"--radix-popper-transform-origin":[O.transformOrigin?.x,O.transformOrigin?.y].join(` `),...O.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,h.jsx)(LP,{scope:n,placedSide:ce,onArrowChange:C,arrowX:de,arrowY:fe,shouldHideArrow:pe,children:(0,h.jsx)(ak.div,{"data-side":ce,"data-align":le,..._,ref:x,style:{..._.style,animation:se?void 0:`none`}})})})});zP.displayName=IP;var BP=`PopperArrow`,VP={top:`bottom`,right:`left`,bottom:`top`,left:`right`},HP=d.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=RP(BP,n),a=VP[i.placedSide];return(0,h.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,h.jsx)(DP,{...r,ref:t,style:{...r.style,display:`block`}})})});HP.displayName=BP;function UP(e){return e!==null}var WP=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=GP(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function GP(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var KP=NP,qP=FP,JP=zP,YP=HP,XP=`Popover`,[ZP,QP]=ck(XP,[AP]),$P=AP(),[eF,tF]=ZP(XP),nF=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=$P(t),c=d.useRef(null),[l,u]=d.useState(!1),[f,p]=pk({prop:r,defaultProp:i??!1,onChange:a,caller:XP});return(0,h.jsx)(KP,{...s,children:(0,h.jsx)(eF,{scope:t,contentId:Ck(),triggerRef:c,open:f,onOpenChange:p,onOpenToggle:d.useCallback(()=>p(e=>!e),[p]),hasCustomAnchor:l,onCustomAnchorAdd:d.useCallback(()=>u(!0),[]),onCustomAnchorRemove:d.useCallback(()=>u(!1),[]),modal:o,children:n})})};nF.displayName=XP;var rF=`PopoverAnchor`,iF=d.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=tF(rF,n),a=$P(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return d.useEffect(()=>(o(),()=>s()),[o,s]),(0,h.jsx)(qP,{...a,...r,ref:t})});iF.displayName=rF;var aF=`PopoverTrigger`,oF=d.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=tF(aF,n),a=$P(n),o=ZO(t,i.triggerRef),s=(0,h.jsx)(ak.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":xF(i.open),...r,ref:o,onClick:uk(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,h.jsx)(qP,{asChild:!0,...a,children:s})});oF.displayName=aF;var sF=`PopoverPortal`,[cF,lF]=ZP(sF,{forceMount:void 0}),uF=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=tF(sF,t);return(0,h.jsx)(cF,{scope:t,forceMount:n,children:(0,h.jsx)(_k,{present:n||a.open,children:(0,h.jsx)(nA,{asChild:!0,container:i,children:r})})})};uF.displayName=sF;var dF=`PopoverContent`,fF=d.forwardRef((e,t)=>{let n=lF(dF,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=tF(dF,e.__scopePopover);return(0,h.jsx)(_k,{present:r||a.open,children:a.modal?(0,h.jsx)(mF,{...i,ref:t}):(0,h.jsx)(hF,{...i,ref:t})})});fF.displayName=dF;var pF=QO(`PopoverContent.RemoveScroll`),mF=d.forwardRef((e,t)=>{let n=tF(dF,e.__scopePopover),r=d.useRef(null),i=ZO(t,r),a=d.useRef(!1);return d.useEffect(()=>{let e=r.current;if(e)return Cj(e)},[]),(0,h.jsx)(mj,{as:pF,allowPinchZoom:!0,children:(0,h.jsx)(gF,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:uk(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:uk(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:uk(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),hF=d.forwardRef((e,t)=>{let n=tF(dF,e.__scopePopover),r=d.useRef(!1),i=d.useRef(!1);return(0,h.jsx)(gF,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),gF=d.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=tF(dF,n),p=$P(n);return iA(),(0,h.jsx)(Uk,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,h.jsx)(Mk,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,h.jsx)(JP,{"data-state":xF(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),_F=`PopoverClose`,vF=d.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=tF(_F,n);return(0,h.jsx)(ak.button,{type:`button`,...r,ref:t,onClick:uk(e.onClick,()=>i.onOpenChange(!1))})});vF.displayName=_F;var yF=`PopoverArrow`,bF=d.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=$P(n);return(0,h.jsx)(YP,{...i,...r,ref:t})});bF.displayName=yF;function xF(e){return e?`open`:`closed`}var SF=nF,CF=oF,wF=uF,TF=fF,EF=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},DF=(e,t)=>({classGroupId:e,validator:t}),OF=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),kF=`-`,AF=[],jF=`arbitrary..`,MF=e=>{let t=FF(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return PF(e);let n=e.split(kF);return NF(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?EF(i,t):t:i||AF}return n[e]||AF}}},NF=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=NF(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(kF):e.slice(t).join(kF),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},PF=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?jF+r:void 0})(),FF=e=>{let{theme:t,classGroups:n}=e;return IF(n,t)},IF=(e,t)=>{let n=OF();for(let r in e){let i=e[r];LF(i,n,r,t)}return n},LF=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];RF(i,t,n,r)}},RF=(e,t,n,r)=>{if(typeof e==`string`){zF(e,t,n);return}if(typeof e==`function`){BF(e,t,n,r);return}VF(e,t,n,r)},zF=(e,t,n)=>{let r=e===``?t:HF(t,e);r.classGroupId=n},BF=(e,t,n,r)=>{if(UF(e)){LF(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(DF(n,e))},VF=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];LF(o,HF(t,a),n,r)}},HF=(e,t)=>{let n=e,r=t.split(kF),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=OF(),n.nextPart.set(t,i)),n=i}return n},UF=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,WF=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},GF=`!`,KF=`:`,qF=[],JF=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),YF=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===KF){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(GF)?(c=s.slice(0,-1),l=!0):s.startsWith(GF)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return JF(t,l,c,u)};if(t){let e=t+KF,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):JF(qF,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},XF=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},ZF=e=>({cache:WF(e.cacheSize),parseClassName:YF(e),sortModifiers:XF(e),postfixLookupClassGroupIds:QF(e),...MF(e)}),QF=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},$F=/\s+/,eI=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split($F),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+GF:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},tI=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=nI(n))&&(i&&(i+=` `),i+=r);return i},nI=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=nI(e[r]))&&(n&&(n+=` `),n+=t);return n},rI=(e,...t)=>{let n,r,i,a,o=o=>(n=ZF(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=eI(e,n);return i(e,a),a};return a=o,(...e)=>a(tI(...e))},iI=[],aI=e=>{let t=t=>t[e]||iI;return t.isThemeGetter=!0,t},oI=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,sI=/^\((?:(\w[\w-]*):)?(.+)\)$/i,cI=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,lI=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,uI=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,dI=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,fI=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,pI=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,mI=e=>cI.test(e),hI=e=>!!e&&!Number.isNaN(Number(e)),gI=e=>!!e&&Number.isInteger(Number(e)),_I=e=>e.endsWith(`%`)&&hI(e.slice(0,-1)),vI=e=>lI.test(e),yI=()=>!0,bI=e=>uI.test(e)&&!dI.test(e),xI=()=>!1,SI=e=>fI.test(e),CI=e=>pI.test(e),wI=e=>!F(e)&&!I(e),TI=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),EI=e=>VI(e,GI,xI),F=e=>oI.test(e),DI=e=>VI(e,KI,bI),OI=e=>VI(e,qI,hI),kI=e=>VI(e,YI,yI),AI=e=>VI(e,JI,xI),jI=e=>VI(e,UI,xI),MI=e=>VI(e,WI,CI),NI=e=>VI(e,XI,SI),I=e=>sI.test(e),PI=e=>HI(e,KI),FI=e=>HI(e,JI),II=e=>HI(e,UI),LI=e=>HI(e,GI),RI=e=>HI(e,WI),zI=e=>HI(e,XI,!0),BI=e=>HI(e,YI,!0),VI=(e,t,n)=>{let r=oI.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},HI=(e,t,n=!1)=>{let r=sI.exec(e);return r?r[1]?t(r[1]):n:!1},UI=e=>e===`position`||e===`percentage`,WI=e=>e===`image`||e===`url`,GI=e=>e===`length`||e===`size`||e===`bg-size`,KI=e=>e===`length`,qI=e=>e===`number`,JI=e=>e===`family-name`,YI=e=>e===`number`||e===`weight`,XI=e=>e===`shadow`,ZI=rI(()=>{let e=aI(`color`),t=aI(`font`),n=aI(`text`),r=aI(`font-weight`),i=aI(`tracking`),a=aI(`leading`),o=aI(`breakpoint`),s=aI(`container`),c=aI(`spacing`),l=aI(`radius`),u=aI(`shadow`),d=aI(`inset-shadow`),f=aI(`text-shadow`),p=aI(`drop-shadow`),m=aI(`blur`),h=aI(`perspective`),g=aI(`aspect`),_=aI(`ease`),v=aI(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),I,F],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[I,F,c],T=()=>[mI,`full`,`auto`,...w()],E=()=>[gI,`none`,`subgrid`,I,F],D=()=>[`auto`,{span:[`full`,gI,I,F]},gI,I,F],ee=()=>[gI,`auto`,I,F],te=()=>[`auto`,`min`,`max`,`fr`,I,F],ne=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],re=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],ie=()=>[`auto`,...w()],ae=()=>[mI,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],oe=()=>[mI,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],se=()=>[mI,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],O=()=>[e,I,F],ce=()=>[...b(),II,jI,{position:[I,F]}],le=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ue=()=>[`auto`,`cover`,`contain`,LI,EI,{size:[I,F]}],de=()=>[_I,PI,DI],fe=()=>[``,`none`,`full`,l,I,F],pe=()=>[``,hI,PI,DI],me=()=>[`solid`,`dashed`,`dotted`,`double`],he=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ge=()=>[hI,_I,II,jI],_e=()=>[``,`none`,m,I,F],ve=()=>[`none`,hI,I,F],ye=()=>[`none`,hI,I,F],be=()=>[hI,I,F],xe=()=>[mI,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[vI],breakpoint:[vI],color:[yI],container:[vI],"drop-shadow":[vI],ease:[`in`,`out`,`in-out`],font:[wI],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[vI],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[vI],shadow:[vI],spacing:[`px`,hI],text:[vI],"text-shadow":[vI],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,mI,F,I,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,I,F]}],"container-named":[TI],columns:[{columns:[hI,F,I,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[gI,`auto`,I,F]}],basis:[{basis:[mI,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[hI,mI,`auto`,`initial`,`none`,F]}],grow:[{grow:[``,hI,I,F]}],shrink:[{shrink:[``,hI,I,F]}],order:[{order:[gI,`first`,`last`,`none`,I,F]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":ee()}],"row-end":[{"row-end":ee()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":te()}],"auto-rows":[{"auto-rows":te()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...ne(),`normal`]}],"justify-items":[{"justify-items":[...re(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...re()]}],"align-content":[{content:[`normal`,...ne()]}],"align-items":[{items:[...re(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...re(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ne()}],"place-items":[{"place-items":[...re(),`baseline`]}],"place-self":[{"place-self":[`auto`,...re()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:ie()}],mx:[{mx:ie()}],my:[{my:ie()}],ms:[{ms:ie()}],me:[{me:ie()}],mbs:[{mbs:ie()}],mbe:[{mbe:ie()}],mt:[{mt:ie()}],mr:[{mr:ie()}],mb:[{mb:ie()}],ml:[{ml:ie()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:ae()}],"inline-size":[{inline:[`auto`,...oe()]}],"min-inline-size":[{"min-inline":[`auto`,...oe()]}],"max-inline-size":[{"max-inline":[`none`,...oe()]}],"block-size":[{block:[`auto`,...se()]}],"min-block-size":[{"min-block":[`auto`,...se()]}],"max-block-size":[{"max-block":[`none`,...se()]}],w:[{w:[s,`screen`,...ae()]}],"min-w":[{"min-w":[s,`screen`,`none`,...ae()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...ae()]}],h:[{h:[`screen`,`lh`,...ae()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...ae()]}],"max-h":[{"max-h":[`screen`,`lh`,...ae()]}],"font-size":[{text:[`base`,n,PI,DI]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,BI,kI]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,_I,F]}],"font-family":[{font:[FI,AI,t]}],"font-features":[{"font-features":[F]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,I,F]}],"line-clamp":[{"line-clamp":[hI,`none`,I,OI]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,I,F]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,I,F]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:O()}],"text-color":[{text:O()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...me(),`wavy`]}],"text-decoration-thickness":[{decoration:[hI,`from-font`,`auto`,I,DI]}],"text-decoration-color":[{decoration:O()}],"underline-offset":[{"underline-offset":[hI,`auto`,I,F]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[gI,I,F]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,I,F]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,I,F]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ce()}],"bg-repeat":[{bg:le()}],"bg-size":[{bg:ue()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},gI,I,F],radial:[``,I,F],conic:[gI,I,F]},RI,MI]}],"bg-color":[{bg:O()}],"gradient-from-pos":[{from:de()}],"gradient-via-pos":[{via:de()}],"gradient-to-pos":[{to:de()}],"gradient-from":[{from:O()}],"gradient-via":[{via:O()}],"gradient-to":[{to:O()}],rounded:[{rounded:fe()}],"rounded-s":[{"rounded-s":fe()}],"rounded-e":[{"rounded-e":fe()}],"rounded-t":[{"rounded-t":fe()}],"rounded-r":[{"rounded-r":fe()}],"rounded-b":[{"rounded-b":fe()}],"rounded-l":[{"rounded-l":fe()}],"rounded-ss":[{"rounded-ss":fe()}],"rounded-se":[{"rounded-se":fe()}],"rounded-ee":[{"rounded-ee":fe()}],"rounded-es":[{"rounded-es":fe()}],"rounded-tl":[{"rounded-tl":fe()}],"rounded-tr":[{"rounded-tr":fe()}],"rounded-br":[{"rounded-br":fe()}],"rounded-bl":[{"rounded-bl":fe()}],"border-w":[{border:pe()}],"border-w-x":[{"border-x":pe()}],"border-w-y":[{"border-y":pe()}],"border-w-s":[{"border-s":pe()}],"border-w-e":[{"border-e":pe()}],"border-w-bs":[{"border-bs":pe()}],"border-w-be":[{"border-be":pe()}],"border-w-t":[{"border-t":pe()}],"border-w-r":[{"border-r":pe()}],"border-w-b":[{"border-b":pe()}],"border-w-l":[{"border-l":pe()}],"divide-x":[{"divide-x":pe()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":pe()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...me(),`hidden`,`none`]}],"divide-style":[{divide:[...me(),`hidden`,`none`]}],"border-color":[{border:O()}],"border-color-x":[{"border-x":O()}],"border-color-y":[{"border-y":O()}],"border-color-s":[{"border-s":O()}],"border-color-e":[{"border-e":O()}],"border-color-bs":[{"border-bs":O()}],"border-color-be":[{"border-be":O()}],"border-color-t":[{"border-t":O()}],"border-color-r":[{"border-r":O()}],"border-color-b":[{"border-b":O()}],"border-color-l":[{"border-l":O()}],"divide-color":[{divide:O()}],"outline-style":[{outline:[...me(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[hI,I,F]}],"outline-w":[{outline:[``,hI,PI,DI]}],"outline-color":[{outline:O()}],shadow:[{shadow:[``,`none`,u,zI,NI]}],"shadow-color":[{shadow:O()}],"inset-shadow":[{"inset-shadow":[`none`,d,zI,NI]}],"inset-shadow-color":[{"inset-shadow":O()}],"ring-w":[{ring:pe()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:O()}],"ring-offset-w":[{"ring-offset":[hI,DI]}],"ring-offset-color":[{"ring-offset":O()}],"inset-ring-w":[{"inset-ring":pe()}],"inset-ring-color":[{"inset-ring":O()}],"text-shadow":[{"text-shadow":[`none`,f,zI,NI]}],"text-shadow-color":[{"text-shadow":O()}],opacity:[{opacity:[hI,I,F]}],"mix-blend":[{"mix-blend":[...he(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":he()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[hI]}],"mask-image-linear-from-pos":[{"mask-linear-from":ge()}],"mask-image-linear-to-pos":[{"mask-linear-to":ge()}],"mask-image-linear-from-color":[{"mask-linear-from":O()}],"mask-image-linear-to-color":[{"mask-linear-to":O()}],"mask-image-t-from-pos":[{"mask-t-from":ge()}],"mask-image-t-to-pos":[{"mask-t-to":ge()}],"mask-image-t-from-color":[{"mask-t-from":O()}],"mask-image-t-to-color":[{"mask-t-to":O()}],"mask-image-r-from-pos":[{"mask-r-from":ge()}],"mask-image-r-to-pos":[{"mask-r-to":ge()}],"mask-image-r-from-color":[{"mask-r-from":O()}],"mask-image-r-to-color":[{"mask-r-to":O()}],"mask-image-b-from-pos":[{"mask-b-from":ge()}],"mask-image-b-to-pos":[{"mask-b-to":ge()}],"mask-image-b-from-color":[{"mask-b-from":O()}],"mask-image-b-to-color":[{"mask-b-to":O()}],"mask-image-l-from-pos":[{"mask-l-from":ge()}],"mask-image-l-to-pos":[{"mask-l-to":ge()}],"mask-image-l-from-color":[{"mask-l-from":O()}],"mask-image-l-to-color":[{"mask-l-to":O()}],"mask-image-x-from-pos":[{"mask-x-from":ge()}],"mask-image-x-to-pos":[{"mask-x-to":ge()}],"mask-image-x-from-color":[{"mask-x-from":O()}],"mask-image-x-to-color":[{"mask-x-to":O()}],"mask-image-y-from-pos":[{"mask-y-from":ge()}],"mask-image-y-to-pos":[{"mask-y-to":ge()}],"mask-image-y-from-color":[{"mask-y-from":O()}],"mask-image-y-to-color":[{"mask-y-to":O()}],"mask-image-radial":[{"mask-radial":[I,F]}],"mask-image-radial-from-pos":[{"mask-radial-from":ge()}],"mask-image-radial-to-pos":[{"mask-radial-to":ge()}],"mask-image-radial-from-color":[{"mask-radial-from":O()}],"mask-image-radial-to-color":[{"mask-radial-to":O()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[hI]}],"mask-image-conic-from-pos":[{"mask-conic-from":ge()}],"mask-image-conic-to-pos":[{"mask-conic-to":ge()}],"mask-image-conic-from-color":[{"mask-conic-from":O()}],"mask-image-conic-to-color":[{"mask-conic-to":O()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ce()}],"mask-repeat":[{mask:le()}],"mask-size":[{mask:ue()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,I,F]}],filter:[{filter:[``,`none`,I,F]}],blur:[{blur:_e()}],brightness:[{brightness:[hI,I,F]}],contrast:[{contrast:[hI,I,F]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,zI,NI]}],"drop-shadow-color":[{"drop-shadow":O()}],grayscale:[{grayscale:[``,hI,I,F]}],"hue-rotate":[{"hue-rotate":[hI,I,F]}],invert:[{invert:[``,hI,I,F]}],saturate:[{saturate:[hI,I,F]}],sepia:[{sepia:[``,hI,I,F]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,I,F]}],"backdrop-blur":[{"backdrop-blur":_e()}],"backdrop-brightness":[{"backdrop-brightness":[hI,I,F]}],"backdrop-contrast":[{"backdrop-contrast":[hI,I,F]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,hI,I,F]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[hI,I,F]}],"backdrop-invert":[{"backdrop-invert":[``,hI,I,F]}],"backdrop-opacity":[{"backdrop-opacity":[hI,I,F]}],"backdrop-saturate":[{"backdrop-saturate":[hI,I,F]}],"backdrop-sepia":[{"backdrop-sepia":[``,hI,I,F]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,I,F]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[hI,`initial`,I,F]}],ease:[{ease:[`linear`,`initial`,_,I,F]}],delay:[{delay:[hI,I,F]}],animate:[{animate:[`none`,v,I,F]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,I,F]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ve()}],"rotate-x":[{"rotate-x":ve()}],"rotate-y":[{"rotate-y":ve()}],"rotate-z":[{"rotate-z":ve()}],scale:[{scale:ye()}],"scale-x":[{"scale-x":ye()}],"scale-y":[{"scale-y":ye()}],"scale-z":[{"scale-z":ye()}],"scale-3d":[`scale-3d`],skew:[{skew:be()}],"skew-x":[{"skew-x":be()}],"skew-y":[{"skew-y":be()}],transform:[{transform:[I,F,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:xe()}],"translate-x":[{"translate-x":xe()}],"translate-y":[{"translate-y":xe()}],"translate-z":[{"translate-z":xe()}],"translate-none":[`translate-none`],zoom:[{zoom:[gI,I,F]}],accent:[{accent:O()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:O()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,I,F]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":O()}],"scrollbar-track-color":[{"scrollbar-track":O()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,I,F]}],fill:[{fill:[`none`,...O()]}],"stroke-w":[{stroke:[hI,PI,DI,OI]}],stroke:[{stroke:[`none`,...O()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function QI(...e){return ZI(S(e))}var $I=JO(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}}),eL=d.forwardRef(function({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i},a){return(0,h.jsx)(r?$O:`button`,{ref:a,"data-slot":`button`,"data-variant":t,"data-size":n,className:QI($I({variant:t,size:n,className:e})),...i})});function tL({...e}){return(0,h.jsx)(iM,{"data-slot":`dialog`,...e})}d.forwardRef(function({...e},t){return(0,h.jsx)(aM,{ref:t,"data-slot":`dialog-trigger`,...e})});function nL({container:e,...t}){return(0,h.jsx)(oM,{"data-slot":`dialog-portal`,container:e??void 0,...t})}d.forwardRef(function({...e},t){return(0,h.jsx)(dM,{ref:t,"data-slot":`dialog-close`,...e})});var rL=d.forwardRef(function({className:e,...t},n){return(0,h.jsx)(sM,{ref:n,"data-slot":`dialog-overlay`,className:QI(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}),iL=d.forwardRef(function({container:e,className:t,children:n,showCloseButton:r=!0,...i},a){return(0,h.jsxs)(nL,{container:e,children:[(0,h.jsx)(rL,{}),(0,h.jsxs)(cM,{ref:a,"data-slot":`dialog-content`,className:QI(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,t),...i,children:[n,r&&(0,h.jsx)(dM,{"data-slot":`dialog-close`,asChild:!0,children:(0,h.jsxs)(eL,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`,children:[(0,h.jsx)(tD,{}),(0,h.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})]})});function aL({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`dialog-header`,className:QI(`flex flex-col gap-2`,e),...t})}function oL({className:e,showCloseButton:t=!1,children:n,...r}){return(0,h.jsxs)(`div`,{"data-slot":`dialog-footer`,className:QI(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,h.jsx)(dM,{asChild:!0,children:(0,h.jsx)(eL,{variant:`outline`,children:`Close`})})]})}var sL=d.forwardRef(function({className:e,...t},n){return(0,h.jsx)(lM,{ref:n,"data-slot":`dialog-title`,className:QI(`text-base leading-none font-medium`,e),...t})}),cL=d.forwardRef(function({className:e,...t},n){return(0,h.jsx)(uM,{ref:n,"data-slot":`dialog-description`,className:QI(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}),lL=5*1024*1024,uL=`zt-md-image-upload-file-input`,dL=e=>new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{let e=r.result;if(typeof e==`string`){t(e);return}n(Error(`Invalid file result`))},r.onerror=()=>{n(r.error??Error(`File read failed`))},r.readAsDataURL(e)}),fL=e=>e<1024*1024?`${Math.ceil(e/1024)}KB`:`${(e/1024/1024).toFixed(1)}MB`,pL=e=>{try{let t=new URL(e);return!!(t.protocol&&t.host)}catch{return!1}},mL=e=>new Promise((t,n)=>{let r=new Image;r.onload=()=>{t()},r.onerror=()=>{n(Error(`Image load failed`))},r.src=e}),hL=({messages:e,portalContainer:t,imageUpload:n,onConfirm:r,onCancel:i})=>{let[a,o]=(0,d.useState)(`file`),[s,c]=(0,d.useState)(null),[l,u]=(0,d.useState)(``),[f,p]=(0,d.useState)(!1),[m,g]=(0,d.useState)(``),[_,v]=(0,d.useState)(!1),[y,b]=(0,d.useState)(!1),[x,S]=(0,d.useState)(!1),C=(0,d.useRef)(null),w=(0,d.useRef)(null),T=(0,d.useRef)(!0),E=n?.maxFileSize??lL,D=_||y,ee=a===`file`&&(D||!!l),te=a===`file`&&!!l&&!D,ne=!l||!!m||D||f,re=(0,d.useCallback)(async t=>{if(!t.type.startsWith(`image/`)){c(null),u(``),g(e.imageUploadInvalidType);return}if(t.size>E){c(null),u(``),g(e.imageUploadFileSizeExceeded.replace(`{size}`,fL(E)));return}g(``),c(t),p(!1),v(!0);try{let r=n?.upload?await n.upload(t):await dL(t);if(!T.current)return;if(!r){u(``),g(e.imageUploadFailed);return}u(r)}catch(t){if(!T.current)return;let r=n?.upload?t instanceof Error?t.message:e.imageUploadFailed:e.imageUploadFileReadFailed;u(``),g(r||e.imageUploadFailed)}finally{T.current&&v(!1)}},[n,E,e]),ie=(0,d.useCallback)(()=>{let e=C.current?.files?.[0];e&&(re(e),C.current.value=``)},[re]),ae=(0,d.useCallback)(t=>{if(c(null),p(!1),u(t),!t){g(``);return}g(pL(t)?``:e.imageUploadInvalidUrl)},[e.imageUploadInvalidUrl]),oe=(0,d.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),!D&&(e.dataTransfer.dropEffect=`copy`,S(!0))},[D]),se=(0,d.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),e.currentTarget.contains(e.relatedTarget)||S(!1)},[]),O=(0,d.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),S(!1),D)return;let t=e.dataTransfer.files?.[0];t&&re(t)},[D,re]),ce=(0,d.useCallback)(e=>{D||(o(e),c(null),u(``),p(!1),g(``))},[D]),le=(0,d.useCallback)(async()=>{if(D){g(e.imageUploadUploadingWait);return}if(!l){g(e.imageUploadSelectOrEnterImage);return}if(a===`url`&&!pL(l)){g(e.imageUploadInvalidUrl);return}g(``),b(!0);try{if(await mL(l),!T.current)return;r({src:l,alt:a===`file`?s?.name??``:``})}catch{T.current&&(p(!0),g(e.imageUploadLoadFailed))}finally{T.current&&b(!1)}},[l,D,e.imageUploadInvalidUrl,e.imageUploadLoadFailed,e.imageUploadSelectOrEnterImage,e.imageUploadUploadingWait,r,s,a]),ue=(0,d.useCallback)(e=>{e.key===`Enter`&&!e.shiftKey&&a===`url`&&(e.preventDefault(),le())},[le,a]);return(0,d.useEffect)(()=>(T.current=!0,()=>{T.current=!1}),[]),(0,d.useEffect)(()=>{a===`url`&&w.current?.focus()},[a]),(0,h.jsx)(tL,{open:!0,onOpenChange:e=>!e&&i(),children:(0,h.jsxs)(iL,{container:t,className:`zt-md-image-upload-content-shell max-w-2xl sm:!max-w-2xl max-h-[90vh] overflow-hidden flex flex-col`,showCloseButton:!1,onCloseAutoFocus:e=>e.preventDefault(),onMouseDown:e=>e.stopPropagation(),onKeyDown:ue,children:[(0,h.jsxs)(aL,{children:[(0,h.jsx)(sL,{children:e.imageUploadDialogTitle}),(0,h.jsx)(cL,{className:`sr-only`,children:`${e.imageUploadFileTab},${e.imageUploadUrlTab}`})]}),(0,h.jsxs)(`div`,{className:`zt-md-image-upload-segmented`,role:`tablist`,"aria-label":e.imageUploadDialogTitle,children:[(0,h.jsx)(eL,{type:`button`,variant:`ghost`,className:`zt-md-image-upload-segment`,"data-active":a===`file`?`true`:`false`,disabled:D,onClick:()=>ce(`file`),children:e.imageUploadFileTab}),(0,h.jsx)(eL,{type:`button`,variant:`ghost`,className:`zt-md-image-upload-segment`,"data-active":a===`url`?`true`:`false`,disabled:D,onClick:()=>ce(`url`),children:e.imageUploadUrlTab})]}),(0,h.jsxs)(`div`,{className:`zt-md-image-upload-content`,children:[a===`file`?(0,h.jsxs)(`div`,{className:`zt-md-image-upload-file`,children:[(0,h.jsx)(`input`,{ref:C,id:uL,type:`file`,accept:`image/*`,className:`zt-md-image-upload-file-input`,disabled:D,onChange:ie}),(0,h.jsx)(`label`,{htmlFor:uL,className:`zt-md-image-upload-file-label`,"data-drag-over":x?`true`:`false`,"data-has-preview":l?`true`:`false`,"data-disabled":D?`true`:`false`,"aria-disabled":D,onClick:e=>{D&&e.preventDefault()},onDragOver:oe,onDragLeave:se,onDrop:O,children:_?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`div`,{className:`zt-md-image-upload-file-icon`,children:(0,h.jsx)(HE,{size:40,className:`zt-md-image-upload-spin`})}),(0,h.jsx)(`div`,{className:`zt-md-image-upload-file-text`,children:e.imageUploadUploadingLabel})]}):l?(0,h.jsx)(`div`,{className:`zt-md-image-upload-file-preview`,children:f?(0,h.jsxs)(`div`,{className:`zt-md-image-upload-preview-error`,children:[(0,h.jsx)(NE,{size:40}),(0,h.jsx)(`span`,{children:e.imageUploadLoadFailed})]}):(0,h.jsx)(`img`,{src:l,alt:``,onLoad:()=>p(!1),onError:()=>p(!0)})}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`div`,{className:`zt-md-image-upload-file-icon`,children:(0,h.jsx)(PE,{size:40})}),(0,h.jsx)(`div`,{className:`zt-md-image-upload-file-text`,children:e.imageUploadDropLabel}),(0,h.jsx)(`div`,{className:`zt-md-image-upload-file-hint`,children:e.imageUploadSupportsAndMax.replace(`{size}`,fL(E))})]})}),ee?(0,h.jsx)(`div`,{className:`zt-md-image-upload-file-hint zt-md-image-upload-reselect-hint`,"data-placeholder":te?`false`:`true`,children:e.imageUploadReselectHint}):null]}):(0,h.jsxs)(`div`,{className:`zt-md-image-upload-url`,children:[(0,h.jsx)(`label`,{className:`zt-md-image-upload-label`,htmlFor:`zt-md-image-upload-url-input`,children:e.imageUploadUrlTab}),(0,h.jsx)(`input`,{ref:w,id:`zt-md-image-upload-url-input`,type:`url`,className:`zt-md-image-upload-url-input`,placeholder:e.imageUploadUrlPlaceholder,value:l,disabled:D,onChange:e=>ae(e.target.value)}),l&&!m?(0,h.jsx)(`div`,{className:`zt-md-image-upload-url-preview`,children:f?(0,h.jsxs)(`div`,{className:`zt-md-image-upload-preview-error`,children:[(0,h.jsx)(NE,{size:32}),(0,h.jsx)(`span`,{children:e.imageUploadLoadFailed})]}):(0,h.jsx)(`img`,{src:l,alt:``,onLoad:()=>p(!1),onError:()=>p(!0)})}):null]}),m?(0,h.jsxs)(`div`,{className:`zt-md-image-upload-error`,role:`alert`,"aria-live":`polite`,children:[(0,h.jsx)(xE,{size:16,className:`zt-md-image-upload-error-icon`}),(0,h.jsx)(`span`,{children:m})]}):null]}),(0,h.jsxs)(oL,{children:[(0,h.jsx)(eL,{type:`button`,variant:`outline`,onClick:i,children:e.imageUploadCancelLabel}),(0,h.jsx)(eL,{type:`button`,disabled:ne,onClick:()=>{le()},children:D?e.imageUploadUploadingLabel:e.imageUploadConfirmLabel})]})]})})},gL=(e,t)=>{let n=t.getBoundingClientRect();e.style.left=`${-n.left}px`,e.style.top=`${-n.top}px`},_L=(e,t)=>{let n=e?.state?.schema?.nodes?.paragraph;return n?t?n.create(null,t):n.createAndFill():null},vL=(e,t)=>{let n=e?.state?.schema?.nodes?.image;return n?n.create(t):null},yL=e=>{let t=e?.state?.selection;if(!t)return!1;let n=t.$to.parent;if(t.$to.parentOffset<n.content.size)return!0;if(t.$to.depth<1)return!1;let r=t.$to.node(t.$to.depth-1);return t.$to.index(t.$to.depth-1)<r.childCount-1},bL=(e,t)=>{let n=[t,t-1,t+1];for(let t of n)if(!(t<0||t>e.content.size)&&e.nodeAt(t)?.type?.name===`image`)return t;return null},xL=(e,t)=>{let n=e.selection.from-t,r=bL(e.doc,n);return r===null?null:N.create(e.doc,r)},SL=(e,t)=>{if(!e?.state||!e?.dispatch)return!1;let n=vL(e,t);if(!n)return!1;let r=yL(e),i=e.state.tr.replaceSelectionWith(n),a=i.selection.to;if(!r){let t=_L(e);t&&i.insert(a,t)}let o=xL(i,n.nodeSize);return o?(i.setSelection(o).scrollIntoView(),e.dispatch(i),!0):!1},CL=e=>{let t=e.portalContainer.closest(`.zt-md`)?.classList.contains(`zt-md-dark`)?`zt-md-dark`:`zt-md-light`,n=document.createElement(`div`);n.className=`zt-md-image-upload-host ${t}`,e.portalContainer.appendChild(n),gL(n,e.portalContainer);let r=()=>{gL(n,e.portalContainer)};window.addEventListener(`resize`,r),window.addEventListener(`scroll`,r,!0);let i=(0,p.createRoot)(n),a=e=>{queueMicrotask(()=>{window.removeEventListener(`resize`,r),window.removeEventListener(`scroll`,r,!0),i.unmount(),n.remove(),e?.()})};i.render((0,d.createElement)(hL,{messages:e.messages,portalContainer:n,imageUpload:e.imageUpload,onConfirm:t=>{let n=SL(e.view,{src:t.src,alt:t.alt,title:``});a(()=>{n&&e.view?.focus?.()})},onCancel:()=>{a(()=>{e.view?.focus?.()})}}))},wL=`math_block`,TL=`Backspace`,EL=e=>e.key!==TL||e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey,DL=e=>{if(e.parent.type.name!==`paragraph`||e.parentOffset!==0||e.depth<1)return null;let t=e.index(e.depth-1);if(t<=0)return null;let n=e.node(e.depth-1).child(t-1);return n.type.name===wL?{previousBlock:n,previousBlockStart:e.before(e.depth)-n.nodeSize}:null},OL=(e,t)=>{let{selection:n}=e.state;if(!n.empty)return!1;let r=n.$from,i=DL(r);if(!i)return!1;let a=r.parent.textContent.length===0,o=r.before(r.depth),s=o+r.parent.nodeSize;t.preventDefault();let c=e.state.tr;return a&&c.delete(o,s),c.setSelection(N.create(c.doc,i.previousBlockStart)).scrollIntoView(),e.dispatch(c),!0},kL=zg(()=>new $c({key:new nl(`zt-md-math-backspace-entry`),props:{handleKeyDown:(e,t)=>EL(t)?!1:OL(e,t)}})),L=class e extends Error{constructor(t,n){var r=`KaTeX parse error: `+t,i,a,o=n&&n.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?r+=` at end of input: `:r+=` at position `+(i+1)+`: `;var c=s.slice(i,a).replace(/[^]/g,`$&̲`),l=i>15?`…`+s.slice(i-15,i):s.slice(0,i),u=a+15<s.length?s.slice(a,a+15)+`…`:s.slice(a);r+=l+c+u}super(r),this.name=`ParseError`,this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,e.prototype),this.position=i,i!=null&&a!=null&&(this.length=a-i),this.rawMessage=t}},AL=/([A-Z])/g,jL=e=>e.replace(AL,`-$1`).toLowerCase(),ML={"&":`&`,">":`>`,"<":`<`,'"':`"`,"'":`'`},NL=/[&><"']/g,PL=e=>String(e).replace(NL,e=>ML[e]),FL=e=>e.type===`ordgroup`||e.type===`color`?e.body.length===1?FL(e.body[0]):e:e.type===`font`?FL(e.body):e,IL=new Set([`mathord`,`textord`,`atom`]),LL=e=>IL.has(FL(e).type),RL=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?t[2]!==`:`||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():`_relative`},zL={displayMode:{type:`boolean`,description:`Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.`,cli:`-d, --display-mode`},output:{type:{enum:[`htmlAndMathml`,`html`,`mathml`]},description:`Determines the markup language of the output.`,cli:`-F, --format <type>`},leqno:{type:`boolean`,description:`Render display math in leqno style (left-justified tags).`},fleqn:{type:`boolean`,description:`Render display math flush left.`},throwOnError:{type:`boolean`,default:!0,cli:`-t, --no-throw-on-error`,cliDescription:`Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error.`},errorColor:{type:`string`,default:`#cc0000`,cli:`-c, --error-color <color>`,cliDescription:`A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.`,cliProcessor:e=>`#`+e},macros:{type:`object`,cli:`-m, --macro <def>`,cliDescription:`Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).`,cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:`number`,description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:`--min-rule-thickness <size>`,cliProcessor:parseFloat},colorIsTextColor:{type:`boolean`,description:`Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.`,cli:`-b, --color-is-text-color`},strict:{type:[{enum:[`warn`,`ignore`,`error`]},`boolean`,`function`],description:`Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.`,cli:`-S, --strict`,cliDefault:!1},trust:{type:[`boolean`,`function`],description:`Trust the input, enabling all HTML features such as \\url.`,cli:`-T, --trust`},maxSize:{type:`number`,default:1/0,description:`If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large`,processor:e=>Math.max(0,e),cli:`-s, --max-size <n>`,cliProcessor:parseInt},maxExpand:{type:`number`,default:1e3,description:`Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.`,processor:e=>Math.max(0,e),cli:`-e, --max-expand <n>`,cliProcessor:e=>e===`Infinity`?1/0:parseInt(e)},globalGroup:{type:`boolean`,cli:!1}};function BL(e){if(typeof e!=`string`)return e.enum[0];switch(e){case`boolean`:return!1;case`string`:return``;case`number`:return 0;case`object`:return{};default:throw Error(`Unexpected schema type; settings must declare an explicit default.`)}}function VL(e){return e.default===void 0?BL(Array.isArray(e.type)?e.type[0]:e.type):e.default}function HL(e,t,n,r){var i=n[t];e[t]=i===void 0?VL(r):r.processor?r.processor(i):i}var UL=class{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e||={};for(var t of Object.keys(zL)){var n=zL[t];n&&HL(this,t,e,n)}}reportNonstrict(e,t,n){var r=this.strict;if(typeof r==`function`&&(r=r(e,t,n)),!(!r||r===`ignore`)){if(r===!0||r===`error`)throw new L(`LaTeX-incompatible input and strict mode is set to 'error': `+(t+` [`+e+`]`),n);r===`warn`?typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)):typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`))}}useStrictBehavior(e,t,n){var r=this.strict;if(typeof r==`function`)try{r=r(e,t,n)}catch{r=`error`}return!r||r===`ignore`?!1:r===!0||r===`error`?!0:r===`warn`?(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)),!1):(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`)),!1)}isTrusted(e){if(`url`in e&&e.url&&!e.protocol){var t=RL(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},WL=class{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return $L[eR[this.id]]}sub(){return $L[tR[this.id]]}fracNum(){return $L[nR[this.id]]}fracDen(){return $L[rR[this.id]]}cramp(){return $L[iR[this.id]]}text(){return $L[aR[this.id]]}isTight(){return this.size>=2}},GL=0,KL=1,qL=2,JL=3,YL=4,XL=5,ZL=6,QL=7,$L=[new WL(GL,0,!1),new WL(KL,0,!0),new WL(qL,1,!1),new WL(JL,1,!0),new WL(YL,2,!1),new WL(XL,2,!0),new WL(ZL,3,!1),new WL(QL,3,!0)],eR=[YL,XL,YL,XL,ZL,QL,ZL,QL],tR=[XL,XL,XL,XL,QL,QL,QL,QL],nR=[qL,JL,YL,XL,ZL,QL,ZL,QL],rR=[JL,JL,XL,XL,QL,QL,QL,QL],iR=[KL,KL,JL,JL,XL,XL,QL,QL],aR=[GL,KL,qL,JL,qL,JL,qL,JL],oR={DISPLAY:$L[GL],TEXT:$L[qL],SCRIPT:$L[YL],SCRIPTSCRIPT:$L[ZL]},sR=[{name:`latin`,blocks:[[256,591],[768,879]]},{name:`cyrillic`,blocks:[[1024,1279]]},{name:`armenian`,blocks:[[1328,1423]]},{name:`brahmic`,blocks:[[2304,4255]]},{name:`georgian`,blocks:[[4256,4351]]},{name:`cjk`,blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:`hangul`,blocks:[[44032,55215]]}];function cR(e){for(var t=0;t<sR.length;t++)for(var n=sR[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}var lR=[];sR.forEach(e=>e.blocks.forEach(e=>lR.push(...e)));function uR(e){for(var t=0;t<lR.length;t+=2)if(e>=lR[t]&&e<=lR[t+1])return!0;return!1}var dR=e=>e+` `+e,fR=80,pR=function(e,t){return`M95,`+(622+e+t)+`
|
|
46
98
|
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
|
47
99
|
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
|
|
48
100
|
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
|
|
@@ -53,7 +105,7 @@ c5.3,-9.3,12,-14,20,-14
|
|
|
53
105
|
H400000v`+(40+e)+`H845.2724
|
|
54
106
|
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
|
|
55
107
|
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
|
|
56
|
-
M`+(834+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},
|
|
108
|
+
M`+(834+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},mR=function(e,t){return`M263,`+(601+e+t)+`c0.7,0,18,39.7,52,119
|
|
57
109
|
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
|
|
58
110
|
c340,-704.7,510.7,-1060.3,512,-1067
|
|
59
111
|
l`+e/2.084+` -`+e+`
|
|
@@ -63,7 +115,7 @@ s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,
|
|
|
63
115
|
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
|
|
64
116
|
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
|
|
65
117
|
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
|
|
66
|
-
M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},
|
|
118
|
+
M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},hR=function(e,t){return`M983 `+(10+e+t)+`
|
|
67
119
|
l`+e/3.13+` -`+e+`
|
|
68
120
|
c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
|
|
69
121
|
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
|
|
@@ -72,7 +124,7 @@ c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
|
|
|
72
124
|
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
|
|
73
125
|
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
|
|
74
126
|
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
|
|
75
|
-
M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},
|
|
127
|
+
M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},gR=function(e,t){return`M424,`+(2398+e+t)+`
|
|
76
128
|
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
|
|
77
129
|
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
|
|
78
130
|
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
|
|
@@ -82,18 +134,18 @@ v`+(40+e)+`H1014.6
|
|
|
82
134
|
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
|
|
83
135
|
c-2,6,-10,9,-24,9
|
|
84
136
|
c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+` `+t+`
|
|
85
|
-
h400000v`+(40+e)+`h-400000z`},
|
|
137
|
+
h400000v`+(40+e)+`h-400000z`},_R=function(e,t){return`M473,`+(2713+e+t)+`
|
|
86
138
|
c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+` -`+e+`
|
|
87
139
|
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
|
|
88
140
|
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
|
|
89
141
|
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
|
|
90
142
|
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
|
|
91
143
|
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
|
|
92
|
-
606zM`+(1001+e)+` `+t+`h400000v`+(40+e)+`H1017.7z`},
|
|
144
|
+
606zM`+(1001+e)+` `+t+`h400000v`+(40+e)+`H1017.7z`},vR=function(e){var t=e/2;return`M400000 `+e+` H0 L`+t+` 0 l65 45 L145 `+(e-80)+` H400000z`},yR=function(e,t,n){var r=n-54-t-e;return`M702 `+(e+t)+`H400000`+(40+e)+`
|
|
93
145
|
H742v`+r+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
|
|
94
146
|
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
|
|
95
147
|
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
|
|
96
|
-
219 661 l218 661zM702 `+t+`H400000v`+(40+e)+`H742z`},
|
|
148
|
+
219 661 l218 661zM702 `+t+`H400000v`+(40+e)+`H742z`},bR=function(e,t,n){t=1e3*t;var r=``;switch(e){case`sqrtMain`:r=pR(t,fR);break;case`sqrtSize1`:r=mR(t,fR);break;case`sqrtSize2`:r=hR(t,fR);break;case`sqrtSize3`:r=gR(t,fR);break;case`sqrtSize4`:r=_R(t,fR);break;case`sqrtTall`:r=yR(t,fR,n)}return r},xR=function(e,t){switch(e){case`⎜`:return dR(`M291 0 H417 V`+t+` H291z`);case`∣`:return dR(`M145 0 H188 V`+t+` H145z`);case`∥`:return dR(`M145 0 H188 V`+t+` H145z`)+dR(`M367 0 H410 V`+t+` H367z`);case`⎟`:return dR(`M457 0 H583 V`+t+` H457z`);case`⎢`:return dR(`M319 0 H403 V`+t+` H319z`);case`⎥`:return dR(`M263 0 H347 V`+t+` H263z`);case`⎪`:return dR(`M384 0 H504 V`+t+` H384z`);case`⏐`:return dR(`M312 0 H355 V`+t+` H312z`);case`‖`:return dR(`M257 0 H300 V`+t+` H257z`)+dR(`M478 0 H521 V`+t+` H478z`);default:return``}},SR={doubleleftarrow:`M262 157
|
|
97
149
|
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
|
|
98
150
|
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
|
|
99
151
|
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
|
|
@@ -139,10 +191,10 @@ m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9
|
|
|
139
191
|
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
|
|
140
192
|
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
|
|
141
193
|
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
|
|
142
|
-
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:
|
|
194
|
+
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:dR(`M40 281 V428 H0 V94 H40 V241 H400000 v40z`),leftbracketunder:dR(`M0 0 h120 V290 H399995 v120 H0z`),leftbracketover:dR(`M0 440 h120 V150 H399995 v-120 H0z`),leftmapsto:dR(`M40 281 V448H0V74H40V241H400000v40z`),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
|
|
143
195
|
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
|
|
144
196
|
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
|
|
145
|
-
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:
|
|
197
|
+
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:dR(`M0 50 h400000 v40H0z m0 194h40000v40H0z`),midbrace:`M200428 334
|
|
146
198
|
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
|
|
147
199
|
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
|
|
148
200
|
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
|
|
@@ -191,7 +243,7 @@ m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown
|
|
|
191
243
|
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
|
|
192
244
|
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
|
|
193
245
|
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
|
|
194
|
-
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:
|
|
246
|
+
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:dR(`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`),rightbracketunder:dR(`M399995 0 h-120 V290 H0 v120 H400000z`),rightbracketover:dR(`M399995 440 h-120 V150 H0 v-120 H399995z`),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
|
|
195
247
|
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
|
|
196
248
|
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
|
|
197
249
|
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
|
|
@@ -264,7 +316,7 @@ M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`
|
|
|
264
316
|
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|
265
317
|
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|
266
318
|
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|
267
|
-
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},
|
|
319
|
+
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},CR=function(e,t){switch(e){case`lbrack`:return`M403 1759 V84 H666 V0 H319 V1759 v`+t+` v1759 v84 h347 v-84
|
|
268
320
|
H403z M403 1759 V0 H319 V1759 v`+t+` v1759 v84 h84z`;case`rbrack`:return`M347 1759 V0 H0 V84 H263 V1759 v`+t+` v1759 H0 v84 H347z
|
|
269
321
|
M347 1759 V0 H263 V1759 v`+t+` v1759 h84z`;case`vert`:return`M145 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
|
|
270
322
|
c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
@@ -292,22 +344,22 @@ c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6
|
|
|
292
344
|
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
|
|
293
345
|
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
|
|
294
346
|
l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
|
|
295
|
-
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw Error(`Unknown stretchy delimiter.`)}};function Ou(e){return`toText`in e}var ku=class{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e=``,t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map(e=>{if(Ou(e))return e.toText();throw Error(`Expected MathDomNode with toText, got `+e.constructor.name)}).join(``)}},Au={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},ju={ex:!0,em:!0,mu:!0},Mu=function(e){return typeof e!=`string`&&(e=e.unit),e in Au||e in ju||e===`ex`},Nu=function(e,t){var n;if(e.unit in Au)n=Au[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit===`mu`)n=t.fontMetrics().cssEmPerMu;else{var r=t.style.isTight()?t.havingStyle(t.style.text()):t;if(e.unit===`ex`)n=r.fontMetrics().xHeight;else if(e.unit===`em`)n=r.fontMetrics().quad;else throw new N(`Invalid unit: '`+e.unit+`'`);r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},F=function(e){return+e.toFixed(4)+`em`},Pu=function(e){return e.filter(e=>e).join(` `)},Fu=function(e){var t=``;for(var n of Object.keys(e)){var r=e[n];r!==void 0&&(t+=Il(n)+`:`+r+`;`)}return t},Iu=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push(`mtight`);var r=t.getColor();r&&(this.style.color=r)}},Lu=function(e){var t=document.createElement(e);t.className=Pu(this.classes),Object.assign(t.style,this.style);for(var n of Object.keys(this.attributes))t.setAttribute(n,this.attributes[n]);for(var r=0;r<this.children.length;r++)t.appendChild(this.children[r].toNode());return t},Ru=/[\s"'>/=\x00-\x1f]/,zu=function(e){var t=`<`+e;this.classes.length&&(t+=` class="`+zl(Pu(this.classes))+`"`);var n=Fu(this.style);n&&(t+=` style="`+zl(n)+`"`);for(var r of Object.keys(this.attributes)){if(Ru.test(r))throw new N(`Invalid attribute name '`+r+`'`);t+=` `+r+`="`+zl(this.attributes[r])+`"`}t+=`>`;for(var i=0;i<this.children.length;i++)t+=this.children[i].toMarkup();return t+=`</`+e+`>`,t},Bu=class{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,Iu.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return Lu.call(this,`span`)}toMarkup(){return zu.call(this,`span`)}},Vu=class{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,Iu.call(this,t,r),this.children=n||[],this.setAttribute(`href`,e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return Lu.call(this,`a`)}toMarkup(){return zu.call(this,`a`)}},Hu=class{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=[`mord`],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement(`img`);return e.src=this.src,e.alt=this.alt,e.className=`mord`,Object.assign(e.style,this.style),e}toMarkup(){var e=`<img src="`+zl(this.src)+`"`+(` alt="`+zl(this.alt)+`"`),t=Fu(this.style);return t&&(e+=` style="`+zl(t)+`"`),e+=`'/>`,e}},Uu={î:`ı̂`,ï:`ı̈`,í:`ı́`,ì:`ı̀`},Wu=class{constructor(e,t,n,r,i,a,o,s){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=r||0,this.skew=i||0,this.width=a||0,this.classes=o||[],this.style=s||{},this.maxFontSize=0;var c=fu(this.text.charCodeAt(0));c&&this.classes.push(c+`_fallback`),/[îïíì]/.test(this.text)&&(this.text=Uu[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;return this.italic>0&&(t=document.createElement(`span`),t.style.marginRight=F(this.italic)),this.classes.length>0&&(t||=document.createElement(`span`),t.className=Pu(this.classes)),Object.keys(this.style).length>0&&(t||=document.createElement(`span`),Object.assign(t.style,this.style)),t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t=`<span`;this.classes.length&&(e=!0,t+=` class="`,t+=zl(Pu(this.classes)),t+=`"`);var n=``;this.italic>0&&(n+=`margin-right:`+F(this.italic)+`;`),n+=Fu(this.style),n&&(e=!0,t+=` style="`+zl(n)+`"`);var r=zl(this.text);return e?(t+=`>`,t+=r,t+=`</span>`,t):r}},Gu=class{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e=`<svg xmlns="http://www.w3.org/2000/svg"`;for(var t of Object.keys(this.attributes))e+=` `+t+`="`+zl(this.attributes[t])+`"`;e+=`>`;for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+=`</svg>`,e}},Ku=class{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return this.alternate?e.setAttribute(`d`,this.alternate):e.setAttribute(`d`,Eu[this.pathName]),e}toMarkup(){return this.alternate?`<path d="`+zl(this.alternate)+`"/>`:`<path d="`+zl(Eu[this.pathName])+`"/>`}},qu=class{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`line`);for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e=`<line`;for(var t of Object.keys(this.attributes))e+=` `+t+`="`+zl(this.attributes[t])+`"`;return e+=`/>`,e}};function Ju(e){if(e instanceof Wu)return e;throw Error(`Expected symbolNode but got `+String(e)+`.`)}function Yu(e){if(e instanceof Bu)return e;throw Error(`Expected span<HtmlDomNode> but got `+String(e)+`.`)}var Xu=e=>e instanceof Bu||e instanceof Vu||e instanceof ku,Zu={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Qu={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},$u={Å:`A`,Ð:`D`,Þ:`o`,å:`a`,ð:`d`,þ:`o`,А:`A`,Б:`B`,В:`B`,Г:`F`,Д:`A`,Е:`E`,Ж:`K`,З:`3`,И:`N`,Й:`N`,К:`K`,Л:`N`,М:`M`,Н:`H`,О:`O`,П:`N`,Р:`P`,С:`C`,Т:`T`,У:`y`,Ф:`O`,Х:`X`,Ц:`U`,Ч:`h`,Ш:`W`,Щ:`W`,Ъ:`B`,Ы:`X`,Ь:`B`,Э:`3`,Ю:`X`,Я:`R`,а:`a`,б:`b`,в:`a`,г:`r`,д:`y`,е:`e`,ж:`m`,з:`e`,и:`n`,й:`n`,к:`n`,л:`n`,м:`m`,н:`n`,о:`o`,п:`n`,р:`p`,с:`c`,т:`o`,у:`y`,ф:`b`,х:`x`,ц:`n`,ч:`n`,ш:`w`,щ:`w`,ъ:`a`,ы:`m`,ь:`a`,э:`e`,ю:`m`,я:`r`};function ed(e,t){Zu[e]=t}function td(e,t,n){if(!Zu[t])throw Error(`Font metrics not found for font: `+t+`.`);var r=e.charCodeAt(0),i=Zu[t][r];if(!i&&e[0]in $u&&(r=$u[e[0]].charCodeAt(0),i=Zu[t][r]),!i&&n===`text`&&mu(r)&&(i=Zu[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var nd={};function rd(e){var t=e>=5?0:e>=3?1:2;if(!nd[t]){var n=nd[t]={cssEmPerMu:Qu.quad[t]/18};for(var r in Qu)Qu.hasOwnProperty(r)&&(n[r]=Qu[r][t])}return nd[t]}var id={math:{},text:{}};function I(e,t,n,r,i,a){id[e][i]={font:t,group:n,replace:r},a&&r&&(id[e][r]=id[e][i])}var L=`math`,R=`text`,z=`main`,B=`ams`,ad=`accent-token`,V=`bin`,od=`close`,sd=`inner`,H=`mathord`,cd=`op-token`,ld=`open`,ud=`punct`,U=`rel`,dd=`spacing`,W=`textord`;I(L,z,U,`≡`,`\\equiv`,!0),I(L,z,U,`≺`,`\\prec`,!0),I(L,z,U,`≻`,`\\succ`,!0),I(L,z,U,`∼`,`\\sim`,!0),I(L,z,U,`⊥`,`\\perp`),I(L,z,U,`⪯`,`\\preceq`,!0),I(L,z,U,`⪰`,`\\succeq`,!0),I(L,z,U,`≃`,`\\simeq`,!0),I(L,z,U,`∣`,`\\mid`,!0),I(L,z,U,`≪`,`\\ll`,!0),I(L,z,U,`≫`,`\\gg`,!0),I(L,z,U,`≍`,`\\asymp`,!0),I(L,z,U,`∥`,`\\parallel`),I(L,z,U,`⋈`,`\\bowtie`,!0),I(L,z,U,`⌣`,`\\smile`,!0),I(L,z,U,`⊑`,`\\sqsubseteq`,!0),I(L,z,U,`⊒`,`\\sqsupseteq`,!0),I(L,z,U,`≐`,`\\doteq`,!0),I(L,z,U,`⌢`,`\\frown`,!0),I(L,z,U,`∋`,`\\ni`,!0),I(L,z,U,`∝`,`\\propto`,!0),I(L,z,U,`⊢`,`\\vdash`,!0),I(L,z,U,`⊣`,`\\dashv`,!0),I(L,z,U,`∋`,`\\owns`),I(L,z,ud,`.`,`\\ldotp`),I(L,z,ud,`⋅`,`\\cdotp`),I(L,z,ud,`⋅`,`·`),I(R,z,W,`⋅`,`·`),I(L,z,W,`#`,`\\#`),I(R,z,W,`#`,`\\#`),I(L,z,W,`&`,`\\&`),I(R,z,W,`&`,`\\&`),I(L,z,W,`ℵ`,`\\aleph`,!0),I(L,z,W,`∀`,`\\forall`,!0),I(L,z,W,`ℏ`,`\\hbar`,!0),I(L,z,W,`∃`,`\\exists`,!0),I(L,z,W,`∇`,`\\nabla`,!0),I(L,z,W,`♭`,`\\flat`,!0),I(L,z,W,`ℓ`,`\\ell`,!0),I(L,z,W,`♮`,`\\natural`,!0),I(L,z,W,`♣`,`\\clubsuit`,!0),I(L,z,W,`℘`,`\\wp`,!0),I(L,z,W,`♯`,`\\sharp`,!0),I(L,z,W,`♢`,`\\diamondsuit`,!0),I(L,z,W,`ℜ`,`\\Re`,!0),I(L,z,W,`♡`,`\\heartsuit`,!0),I(L,z,W,`ℑ`,`\\Im`,!0),I(L,z,W,`♠`,`\\spadesuit`,!0),I(L,z,W,`§`,`\\S`,!0),I(R,z,W,`§`,`\\S`),I(L,z,W,`¶`,`\\P`,!0),I(R,z,W,`¶`,`\\P`),I(L,z,W,`†`,`\\dag`),I(R,z,W,`†`,`\\dag`),I(R,z,W,`†`,`\\textdagger`),I(L,z,W,`‡`,`\\ddag`),I(R,z,W,`‡`,`\\ddag`),I(R,z,W,`‡`,`\\textdaggerdbl`),I(L,z,od,`⎱`,`\\rmoustache`,!0),I(L,z,ld,`⎰`,`\\lmoustache`,!0),I(L,z,od,`⟯`,`\\rgroup`,!0),I(L,z,ld,`⟮`,`\\lgroup`,!0),I(L,z,V,`∓`,`\\mp`,!0),I(L,z,V,`⊖`,`\\ominus`,!0),I(L,z,V,`⊎`,`\\uplus`,!0),I(L,z,V,`⊓`,`\\sqcap`,!0),I(L,z,V,`∗`,`\\ast`),I(L,z,V,`⊔`,`\\sqcup`,!0),I(L,z,V,`◯`,`\\bigcirc`,!0),I(L,z,V,`∙`,`\\bullet`,!0),I(L,z,V,`‡`,`\\ddagger`),I(L,z,V,`≀`,`\\wr`,!0),I(L,z,V,`⨿`,`\\amalg`),I(L,z,V,`&`,`\\And`),I(L,z,U,`⟵`,`\\longleftarrow`,!0),I(L,z,U,`⇐`,`\\Leftarrow`,!0),I(L,z,U,`⟸`,`\\Longleftarrow`,!0),I(L,z,U,`⟶`,`\\longrightarrow`,!0),I(L,z,U,`⇒`,`\\Rightarrow`,!0),I(L,z,U,`⟹`,`\\Longrightarrow`,!0),I(L,z,U,`↔`,`\\leftrightarrow`,!0),I(L,z,U,`⟷`,`\\longleftrightarrow`,!0),I(L,z,U,`⇔`,`\\Leftrightarrow`,!0),I(L,z,U,`⟺`,`\\Longleftrightarrow`,!0),I(L,z,U,`↦`,`\\mapsto`,!0),I(L,z,U,`⟼`,`\\longmapsto`,!0),I(L,z,U,`↗`,`\\nearrow`,!0),I(L,z,U,`↩`,`\\hookleftarrow`,!0),I(L,z,U,`↪`,`\\hookrightarrow`,!0),I(L,z,U,`↘`,`\\searrow`,!0),I(L,z,U,`↼`,`\\leftharpoonup`,!0),I(L,z,U,`⇀`,`\\rightharpoonup`,!0),I(L,z,U,`↙`,`\\swarrow`,!0),I(L,z,U,`↽`,`\\leftharpoondown`,!0),I(L,z,U,`⇁`,`\\rightharpoondown`,!0),I(L,z,U,`↖`,`\\nwarrow`,!0),I(L,z,U,`⇌`,`\\rightleftharpoons`,!0),I(L,B,U,`≮`,`\\nless`,!0),I(L,B,U,``,`\\@nleqslant`),I(L,B,U,``,`\\@nleqq`),I(L,B,U,`⪇`,`\\lneq`,!0),I(L,B,U,`≨`,`\\lneqq`,!0),I(L,B,U,``,`\\@lvertneqq`),I(L,B,U,`⋦`,`\\lnsim`,!0),I(L,B,U,`⪉`,`\\lnapprox`,!0),I(L,B,U,`⊀`,`\\nprec`,!0),I(L,B,U,`⋠`,`\\npreceq`,!0),I(L,B,U,`⋨`,`\\precnsim`,!0),I(L,B,U,`⪹`,`\\precnapprox`,!0),I(L,B,U,`≁`,`\\nsim`,!0),I(L,B,U,``,`\\@nshortmid`),I(L,B,U,`∤`,`\\nmid`,!0),I(L,B,U,`⊬`,`\\nvdash`,!0),I(L,B,U,`⊭`,`\\nvDash`,!0),I(L,B,U,`⋪`,`\\ntriangleleft`),I(L,B,U,`⋬`,`\\ntrianglelefteq`,!0),I(L,B,U,`⊊`,`\\subsetneq`,!0),I(L,B,U,``,`\\@varsubsetneq`),I(L,B,U,`⫋`,`\\subsetneqq`,!0),I(L,B,U,``,`\\@varsubsetneqq`),I(L,B,U,`≯`,`\\ngtr`,!0),I(L,B,U,``,`\\@ngeqslant`),I(L,B,U,``,`\\@ngeqq`),I(L,B,U,`⪈`,`\\gneq`,!0),I(L,B,U,`≩`,`\\gneqq`,!0),I(L,B,U,``,`\\@gvertneqq`),I(L,B,U,`⋧`,`\\gnsim`,!0),I(L,B,U,`⪊`,`\\gnapprox`,!0),I(L,B,U,`⊁`,`\\nsucc`,!0),I(L,B,U,`⋡`,`\\nsucceq`,!0),I(L,B,U,`⋩`,`\\succnsim`,!0),I(L,B,U,`⪺`,`\\succnapprox`,!0),I(L,B,U,`≆`,`\\ncong`,!0),I(L,B,U,``,`\\@nshortparallel`),I(L,B,U,`∦`,`\\nparallel`,!0),I(L,B,U,`⊯`,`\\nVDash`,!0),I(L,B,U,`⋫`,`\\ntriangleright`),I(L,B,U,`⋭`,`\\ntrianglerighteq`,!0),I(L,B,U,``,`\\@nsupseteqq`),I(L,B,U,`⊋`,`\\supsetneq`,!0),I(L,B,U,``,`\\@varsupsetneq`),I(L,B,U,`⫌`,`\\supsetneqq`,!0),I(L,B,U,``,`\\@varsupsetneqq`),I(L,B,U,`⊮`,`\\nVdash`,!0),I(L,B,U,`⪵`,`\\precneqq`,!0),I(L,B,U,`⪶`,`\\succneqq`,!0),I(L,B,U,``,`\\@nsubseteqq`),I(L,B,V,`⊴`,`\\unlhd`),I(L,B,V,`⊵`,`\\unrhd`),I(L,B,U,`↚`,`\\nleftarrow`,!0),I(L,B,U,`↛`,`\\nrightarrow`,!0),I(L,B,U,`⇍`,`\\nLeftarrow`,!0),I(L,B,U,`⇏`,`\\nRightarrow`,!0),I(L,B,U,`↮`,`\\nleftrightarrow`,!0),I(L,B,U,`⇎`,`\\nLeftrightarrow`,!0),I(L,B,U,`△`,`\\vartriangle`),I(L,B,W,`ℏ`,`\\hslash`),I(L,B,W,`▽`,`\\triangledown`),I(L,B,W,`◊`,`\\lozenge`),I(L,B,W,`Ⓢ`,`\\circledS`),I(L,B,W,`®`,`\\circledR`),I(R,B,W,`®`,`\\circledR`),I(L,B,W,`∡`,`\\measuredangle`,!0),I(L,B,W,`∄`,`\\nexists`),I(L,B,W,`℧`,`\\mho`),I(L,B,W,`Ⅎ`,`\\Finv`,!0),I(L,B,W,`⅁`,`\\Game`,!0),I(L,B,W,`‵`,`\\backprime`),I(L,B,W,`▲`,`\\blacktriangle`),I(L,B,W,`▼`,`\\blacktriangledown`),I(L,B,W,`■`,`\\blacksquare`),I(L,B,W,`⧫`,`\\blacklozenge`),I(L,B,W,`★`,`\\bigstar`),I(L,B,W,`∢`,`\\sphericalangle`,!0),I(L,B,W,`∁`,`\\complement`,!0),I(L,B,W,`ð`,`\\eth`,!0),I(R,z,W,`ð`,`ð`),I(L,B,W,`╱`,`\\diagup`),I(L,B,W,`╲`,`\\diagdown`),I(L,B,W,`□`,`\\square`),I(L,B,W,`□`,`\\Box`),I(L,B,W,`◊`,`\\Diamond`),I(L,B,W,`¥`,`\\yen`,!0),I(R,B,W,`¥`,`\\yen`,!0),I(L,B,W,`✓`,`\\checkmark`,!0),I(R,B,W,`✓`,`\\checkmark`),I(L,B,W,`ℶ`,`\\beth`,!0),I(L,B,W,`ℸ`,`\\daleth`,!0),I(L,B,W,`ℷ`,`\\gimel`,!0),I(L,B,W,`ϝ`,`\\digamma`,!0),I(L,B,W,`ϰ`,`\\varkappa`),I(L,B,ld,`┌`,`\\@ulcorner`,!0),I(L,B,od,`┐`,`\\@urcorner`,!0),I(L,B,ld,`└`,`\\@llcorner`,!0),I(L,B,od,`┘`,`\\@lrcorner`,!0),I(L,B,U,`≦`,`\\leqq`,!0),I(L,B,U,`⩽`,`\\leqslant`,!0),I(L,B,U,`⪕`,`\\eqslantless`,!0),I(L,B,U,`≲`,`\\lesssim`,!0),I(L,B,U,`⪅`,`\\lessapprox`,!0),I(L,B,U,`≊`,`\\approxeq`,!0),I(L,B,V,`⋖`,`\\lessdot`),I(L,B,U,`⋘`,`\\lll`,!0),I(L,B,U,`≶`,`\\lessgtr`,!0),I(L,B,U,`⋚`,`\\lesseqgtr`,!0),I(L,B,U,`⪋`,`\\lesseqqgtr`,!0),I(L,B,U,`≑`,`\\doteqdot`),I(L,B,U,`≓`,`\\risingdotseq`,!0),I(L,B,U,`≒`,`\\fallingdotseq`,!0),I(L,B,U,`∽`,`\\backsim`,!0),I(L,B,U,`⋍`,`\\backsimeq`,!0),I(L,B,U,`⫅`,`\\subseteqq`,!0),I(L,B,U,`⋐`,`\\Subset`,!0),I(L,B,U,`⊏`,`\\sqsubset`,!0),I(L,B,U,`≼`,`\\preccurlyeq`,!0),I(L,B,U,`⋞`,`\\curlyeqprec`,!0),I(L,B,U,`≾`,`\\precsim`,!0),I(L,B,U,`⪷`,`\\precapprox`,!0),I(L,B,U,`⊲`,`\\vartriangleleft`),I(L,B,U,`⊴`,`\\trianglelefteq`),I(L,B,U,`⊨`,`\\vDash`,!0),I(L,B,U,`⊪`,`\\Vvdash`,!0),I(L,B,U,`⌣`,`\\smallsmile`),I(L,B,U,`⌢`,`\\smallfrown`),I(L,B,U,`≏`,`\\bumpeq`,!0),I(L,B,U,`≎`,`\\Bumpeq`,!0),I(L,B,U,`≧`,`\\geqq`,!0),I(L,B,U,`⩾`,`\\geqslant`,!0),I(L,B,U,`⪖`,`\\eqslantgtr`,!0),I(L,B,U,`≳`,`\\gtrsim`,!0),I(L,B,U,`⪆`,`\\gtrapprox`,!0),I(L,B,V,`⋗`,`\\gtrdot`),I(L,B,U,`⋙`,`\\ggg`,!0),I(L,B,U,`≷`,`\\gtrless`,!0),I(L,B,U,`⋛`,`\\gtreqless`,!0),I(L,B,U,`⪌`,`\\gtreqqless`,!0),I(L,B,U,`≖`,`\\eqcirc`,!0),I(L,B,U,`≗`,`\\circeq`,!0),I(L,B,U,`≜`,`\\triangleq`,!0),I(L,B,U,`∼`,`\\thicksim`),I(L,B,U,`≈`,`\\thickapprox`),I(L,B,U,`⫆`,`\\supseteqq`,!0),I(L,B,U,`⋑`,`\\Supset`,!0),I(L,B,U,`⊐`,`\\sqsupset`,!0),I(L,B,U,`≽`,`\\succcurlyeq`,!0),I(L,B,U,`⋟`,`\\curlyeqsucc`,!0),I(L,B,U,`≿`,`\\succsim`,!0),I(L,B,U,`⪸`,`\\succapprox`,!0),I(L,B,U,`⊳`,`\\vartriangleright`),I(L,B,U,`⊵`,`\\trianglerighteq`),I(L,B,U,`⊩`,`\\Vdash`,!0),I(L,B,U,`∣`,`\\shortmid`),I(L,B,U,`∥`,`\\shortparallel`),I(L,B,U,`≬`,`\\between`,!0),I(L,B,U,`⋔`,`\\pitchfork`,!0),I(L,B,U,`∝`,`\\varpropto`),I(L,B,U,`◀`,`\\blacktriangleleft`),I(L,B,U,`∴`,`\\therefore`,!0),I(L,B,U,`∍`,`\\backepsilon`),I(L,B,U,`▶`,`\\blacktriangleright`),I(L,B,U,`∵`,`\\because`,!0),I(L,B,U,`⋘`,`\\llless`),I(L,B,U,`⋙`,`\\gggtr`),I(L,B,V,`⊲`,`\\lhd`),I(L,B,V,`⊳`,`\\rhd`),I(L,B,U,`≂`,`\\eqsim`,!0),I(L,z,U,`⋈`,`\\Join`),I(L,B,U,`≑`,`\\Doteq`,!0),I(L,B,V,`∔`,`\\dotplus`,!0),I(L,B,V,`∖`,`\\smallsetminus`),I(L,B,V,`⋒`,`\\Cap`,!0),I(L,B,V,`⋓`,`\\Cup`,!0),I(L,B,V,`⩞`,`\\doublebarwedge`,!0),I(L,B,V,`⊟`,`\\boxminus`,!0),I(L,B,V,`⊞`,`\\boxplus`,!0),I(L,B,V,`⋇`,`\\divideontimes`,!0),I(L,B,V,`⋉`,`\\ltimes`,!0),I(L,B,V,`⋊`,`\\rtimes`,!0),I(L,B,V,`⋋`,`\\leftthreetimes`,!0),I(L,B,V,`⋌`,`\\rightthreetimes`,!0),I(L,B,V,`⋏`,`\\curlywedge`,!0),I(L,B,V,`⋎`,`\\curlyvee`,!0),I(L,B,V,`⊝`,`\\circleddash`,!0),I(L,B,V,`⊛`,`\\circledast`,!0),I(L,B,V,`⋅`,`\\centerdot`),I(L,B,V,`⊺`,`\\intercal`,!0),I(L,B,V,`⋒`,`\\doublecap`),I(L,B,V,`⋓`,`\\doublecup`),I(L,B,V,`⊠`,`\\boxtimes`,!0),I(L,B,U,`⇢`,`\\dashrightarrow`,!0),I(L,B,U,`⇠`,`\\dashleftarrow`,!0),I(L,B,U,`⇇`,`\\leftleftarrows`,!0),I(L,B,U,`⇆`,`\\leftrightarrows`,!0),I(L,B,U,`⇚`,`\\Lleftarrow`,!0),I(L,B,U,`↞`,`\\twoheadleftarrow`,!0),I(L,B,U,`↢`,`\\leftarrowtail`,!0),I(L,B,U,`↫`,`\\looparrowleft`,!0),I(L,B,U,`⇋`,`\\leftrightharpoons`,!0),I(L,B,U,`↶`,`\\curvearrowleft`,!0),I(L,B,U,`↺`,`\\circlearrowleft`,!0),I(L,B,U,`↰`,`\\Lsh`,!0),I(L,B,U,`⇈`,`\\upuparrows`,!0),I(L,B,U,`↿`,`\\upharpoonleft`,!0),I(L,B,U,`⇃`,`\\downharpoonleft`,!0),I(L,z,U,`⊶`,`\\origof`,!0),I(L,z,U,`⊷`,`\\imageof`,!0),I(L,B,U,`⊸`,`\\multimap`,!0),I(L,B,U,`↭`,`\\leftrightsquigarrow`,!0),I(L,B,U,`⇉`,`\\rightrightarrows`,!0),I(L,B,U,`⇄`,`\\rightleftarrows`,!0),I(L,B,U,`↠`,`\\twoheadrightarrow`,!0),I(L,B,U,`↣`,`\\rightarrowtail`,!0),I(L,B,U,`↬`,`\\looparrowright`,!0),I(L,B,U,`↷`,`\\curvearrowright`,!0),I(L,B,U,`↻`,`\\circlearrowright`,!0),I(L,B,U,`↱`,`\\Rsh`,!0),I(L,B,U,`⇊`,`\\downdownarrows`,!0),I(L,B,U,`↾`,`\\upharpoonright`,!0),I(L,B,U,`⇂`,`\\downharpoonright`,!0),I(L,B,U,`⇝`,`\\rightsquigarrow`,!0),I(L,B,U,`⇝`,`\\leadsto`),I(L,B,U,`⇛`,`\\Rrightarrow`,!0),I(L,B,U,`↾`,`\\restriction`),I(L,z,W,`‘`,"`"),I(L,z,W,`$`,`\\$`),I(R,z,W,`$`,`\\$`),I(R,z,W,`$`,`\\textdollar`),I(L,z,W,`%`,`\\%`),I(R,z,W,`%`,`\\%`),I(L,z,W,`_`,`\\_`),I(R,z,W,`_`,`\\_`),I(R,z,W,`_`,`\\textunderscore`),I(L,z,W,`∠`,`\\angle`,!0),I(L,z,W,`∞`,`\\infty`,!0),I(L,z,W,`′`,`\\prime`),I(L,z,W,`△`,`\\triangle`),I(L,z,W,`Γ`,`\\Gamma`,!0),I(L,z,W,`Δ`,`\\Delta`,!0),I(L,z,W,`Θ`,`\\Theta`,!0),I(L,z,W,`Λ`,`\\Lambda`,!0),I(L,z,W,`Ξ`,`\\Xi`,!0),I(L,z,W,`Π`,`\\Pi`,!0),I(L,z,W,`Σ`,`\\Sigma`,!0),I(L,z,W,`Υ`,`\\Upsilon`,!0),I(L,z,W,`Φ`,`\\Phi`,!0),I(L,z,W,`Ψ`,`\\Psi`,!0),I(L,z,W,`Ω`,`\\Omega`,!0),I(L,z,W,`A`,`Α`),I(L,z,W,`B`,`Β`),I(L,z,W,`E`,`Ε`),I(L,z,W,`Z`,`Ζ`),I(L,z,W,`H`,`Η`),I(L,z,W,`I`,`Ι`),I(L,z,W,`K`,`Κ`),I(L,z,W,`M`,`Μ`),I(L,z,W,`N`,`Ν`),I(L,z,W,`O`,`Ο`),I(L,z,W,`P`,`Ρ`),I(L,z,W,`T`,`Τ`),I(L,z,W,`X`,`Χ`),I(L,z,W,`¬`,`\\neg`,!0),I(L,z,W,`¬`,`\\lnot`),I(L,z,W,`⊤`,`\\top`),I(L,z,W,`⊥`,`\\bot`),I(L,z,W,`∅`,`\\emptyset`),I(L,B,W,`∅`,`\\varnothing`),I(L,z,H,`α`,`\\alpha`,!0),I(L,z,H,`β`,`\\beta`,!0),I(L,z,H,`γ`,`\\gamma`,!0),I(L,z,H,`δ`,`\\delta`,!0),I(L,z,H,`ϵ`,`\\epsilon`,!0),I(L,z,H,`ζ`,`\\zeta`,!0),I(L,z,H,`η`,`\\eta`,!0),I(L,z,H,`θ`,`\\theta`,!0),I(L,z,H,`ι`,`\\iota`,!0),I(L,z,H,`κ`,`\\kappa`,!0),I(L,z,H,`λ`,`\\lambda`,!0),I(L,z,H,`μ`,`\\mu`,!0),I(L,z,H,`ν`,`\\nu`,!0),I(L,z,H,`ξ`,`\\xi`,!0),I(L,z,H,`ο`,`\\omicron`,!0),I(L,z,H,`π`,`\\pi`,!0),I(L,z,H,`ρ`,`\\rho`,!0),I(L,z,H,`σ`,`\\sigma`,!0),I(L,z,H,`τ`,`\\tau`,!0),I(L,z,H,`υ`,`\\upsilon`,!0),I(L,z,H,`ϕ`,`\\phi`,!0),I(L,z,H,`χ`,`\\chi`,!0),I(L,z,H,`ψ`,`\\psi`,!0),I(L,z,H,`ω`,`\\omega`,!0),I(L,z,H,`ε`,`\\varepsilon`,!0),I(L,z,H,`ϑ`,`\\vartheta`,!0),I(L,z,H,`ϖ`,`\\varpi`,!0),I(L,z,H,`ϱ`,`\\varrho`,!0),I(L,z,H,`ς`,`\\varsigma`,!0),I(L,z,H,`φ`,`\\varphi`,!0),I(L,z,V,`∗`,`*`,!0),I(L,z,V,`+`,`+`),I(L,z,V,`−`,`-`,!0),I(L,z,V,`⋅`,`\\cdot`,!0),I(L,z,V,`∘`,`\\circ`,!0),I(L,z,V,`÷`,`\\div`,!0),I(L,z,V,`±`,`\\pm`,!0),I(L,z,V,`×`,`\\times`,!0),I(L,z,V,`∩`,`\\cap`,!0),I(L,z,V,`∪`,`\\cup`,!0),I(L,z,V,`∖`,`\\setminus`,!0),I(L,z,V,`∧`,`\\land`),I(L,z,V,`∨`,`\\lor`),I(L,z,V,`∧`,`\\wedge`,!0),I(L,z,V,`∨`,`\\vee`,!0),I(L,z,W,`√`,`\\surd`),I(L,z,ld,`⟨`,`\\langle`,!0),I(L,z,ld,`∣`,`\\lvert`),I(L,z,ld,`∥`,`\\lVert`),I(L,z,od,`?`,`?`),I(L,z,od,`!`,`!`),I(L,z,od,`⟩`,`\\rangle`,!0),I(L,z,od,`∣`,`\\rvert`),I(L,z,od,`∥`,`\\rVert`),I(L,z,U,`=`,`=`),I(L,z,U,`:`,`:`),I(L,z,U,`≈`,`\\approx`,!0),I(L,z,U,`≅`,`\\cong`,!0),I(L,z,U,`≥`,`\\ge`),I(L,z,U,`≥`,`\\geq`,!0),I(L,z,U,`←`,`\\gets`),I(L,z,U,`>`,`\\gt`,!0),I(L,z,U,`∈`,`\\in`,!0),I(L,z,U,``,`\\@not`),I(L,z,U,`⊂`,`\\subset`,!0),I(L,z,U,`⊃`,`\\supset`,!0),I(L,z,U,`⊆`,`\\subseteq`,!0),I(L,z,U,`⊇`,`\\supseteq`,!0),I(L,B,U,`⊈`,`\\nsubseteq`,!0),I(L,B,U,`⊉`,`\\nsupseteq`,!0),I(L,z,U,`⊨`,`\\models`),I(L,z,U,`←`,`\\leftarrow`,!0),I(L,z,U,`≤`,`\\le`),I(L,z,U,`≤`,`\\leq`,!0),I(L,z,U,`<`,`\\lt`,!0),I(L,z,U,`→`,`\\rightarrow`,!0),I(L,z,U,`→`,`\\to`),I(L,B,U,`≱`,`\\ngeq`,!0),I(L,B,U,`≰`,`\\nleq`,!0),I(L,z,dd,`\xA0`,`\\ `),I(L,z,dd,`\xA0`,`\\space`),I(L,z,dd,`\xA0`,`\\nobreakspace`),I(R,z,dd,`\xA0`,`\\ `),I(R,z,dd,`\xA0`,` `),I(R,z,dd,`\xA0`,`\\space`),I(R,z,dd,`\xA0`,`\\nobreakspace`),I(L,z,dd,``,`\\nobreak`),I(L,z,dd,``,`\\allowbreak`),I(L,z,ud,`,`,`,`),I(L,z,ud,`;`,`;`),I(L,B,V,`⊼`,`\\barwedge`,!0),I(L,B,V,`⊻`,`\\veebar`,!0),I(L,z,V,`⊙`,`\\odot`,!0),I(L,z,V,`⊕`,`\\oplus`,!0),I(L,z,V,`⊗`,`\\otimes`,!0),I(L,z,W,`∂`,`\\partial`,!0),I(L,z,V,`⊘`,`\\oslash`,!0),I(L,B,V,`⊚`,`\\circledcirc`,!0),I(L,B,V,`⊡`,`\\boxdot`,!0),I(L,z,V,`△`,`\\bigtriangleup`),I(L,z,V,`▽`,`\\bigtriangledown`),I(L,z,V,`†`,`\\dagger`),I(L,z,V,`⋄`,`\\diamond`),I(L,z,V,`⋆`,`\\star`),I(L,z,V,`◃`,`\\triangleleft`),I(L,z,V,`▹`,`\\triangleright`),I(L,z,ld,`{`,`\\{`),I(R,z,W,`{`,`\\{`),I(R,z,W,`{`,`\\textbraceleft`),I(L,z,od,`}`,`\\}`),I(R,z,W,`}`,`\\}`),I(R,z,W,`}`,`\\textbraceright`),I(L,z,ld,`{`,`\\lbrace`),I(L,z,od,`}`,`\\rbrace`),I(L,z,ld,`[`,`\\lbrack`,!0),I(R,z,W,`[`,`\\lbrack`,!0),I(L,z,od,`]`,`\\rbrack`,!0),I(R,z,W,`]`,`\\rbrack`,!0),I(L,z,ld,`(`,`\\lparen`,!0),I(L,z,od,`)`,`\\rparen`,!0),I(R,z,W,`<`,`\\textless`,!0),I(R,z,W,`>`,`\\textgreater`,!0),I(L,z,ld,`⌊`,`\\lfloor`,!0),I(L,z,od,`⌋`,`\\rfloor`,!0),I(L,z,ld,`⌈`,`\\lceil`,!0),I(L,z,od,`⌉`,`\\rceil`,!0),I(L,z,W,`\\`,`\\backslash`),I(L,z,W,`∣`,`|`),I(L,z,W,`∣`,`\\vert`),I(R,z,W,`|`,`\\textbar`,!0),I(L,z,W,`∥`,`\\|`),I(L,z,W,`∥`,`\\Vert`),I(R,z,W,`∥`,`\\textbardbl`),I(R,z,W,`~`,`\\textasciitilde`),I(R,z,W,`\\`,`\\textbackslash`),I(R,z,W,`^`,`\\textasciicircum`),I(L,z,U,`↑`,`\\uparrow`,!0),I(L,z,U,`⇑`,`\\Uparrow`,!0),I(L,z,U,`↓`,`\\downarrow`,!0),I(L,z,U,`⇓`,`\\Downarrow`,!0),I(L,z,U,`↕`,`\\updownarrow`,!0),I(L,z,U,`⇕`,`\\Updownarrow`,!0),I(L,z,cd,`∐`,`\\coprod`),I(L,z,cd,`⋁`,`\\bigvee`),I(L,z,cd,`⋀`,`\\bigwedge`),I(L,z,cd,`⨄`,`\\biguplus`),I(L,z,cd,`⋂`,`\\bigcap`),I(L,z,cd,`⋃`,`\\bigcup`),I(L,z,cd,`∫`,`\\int`),I(L,z,cd,`∫`,`\\intop`),I(L,z,cd,`∬`,`\\iint`),I(L,z,cd,`∭`,`\\iiint`),I(L,z,cd,`∏`,`\\prod`),I(L,z,cd,`∑`,`\\sum`),I(L,z,cd,`⨂`,`\\bigotimes`),I(L,z,cd,`⨁`,`\\bigoplus`),I(L,z,cd,`⨀`,`\\bigodot`),I(L,z,cd,`∮`,`\\oint`),I(L,z,cd,`∯`,`\\oiint`),I(L,z,cd,`∰`,`\\oiiint`),I(L,z,cd,`⨆`,`\\bigsqcup`),I(L,z,cd,`∫`,`\\smallint`),I(R,z,sd,`…`,`\\textellipsis`),I(L,z,sd,`…`,`\\mathellipsis`),I(R,z,sd,`…`,`\\ldots`,!0),I(L,z,sd,`…`,`\\ldots`,!0),I(L,z,sd,`⋯`,`\\@cdots`,!0),I(L,z,sd,`⋱`,`\\ddots`,!0),I(L,z,W,`⋮`,`\\varvdots`),I(R,z,W,`⋮`,`\\varvdots`),I(L,z,ad,`ˊ`,`\\acute`),I(L,z,ad,`ˋ`,`\\grave`),I(L,z,ad,`¨`,`\\ddot`),I(L,z,ad,`~`,`\\tilde`),I(L,z,ad,`ˉ`,`\\bar`),I(L,z,ad,`˘`,`\\breve`),I(L,z,ad,`ˇ`,`\\check`),I(L,z,ad,`^`,`\\hat`),I(L,z,ad,`⃗`,`\\vec`),I(L,z,ad,`˙`,`\\dot`),I(L,z,ad,`˚`,`\\mathring`),I(L,z,H,``,`\\@imath`),I(L,z,H,``,`\\@jmath`),I(L,z,W,`ı`,`ı`),I(L,z,W,`ȷ`,`ȷ`),I(R,z,W,`ı`,`\\i`,!0),I(R,z,W,`ȷ`,`\\j`,!0),I(R,z,W,`ß`,`\\ss`,!0),I(R,z,W,`æ`,`\\ae`,!0),I(R,z,W,`œ`,`\\oe`,!0),I(R,z,W,`ø`,`\\o`,!0),I(R,z,W,`Æ`,`\\AE`,!0),I(R,z,W,`Œ`,`\\OE`,!0),I(R,z,W,`Ø`,`\\O`,!0),I(R,z,ad,`ˊ`,`\\'`),I(R,z,ad,`ˋ`,"\\`"),I(R,z,ad,`ˆ`,`\\^`),I(R,z,ad,`˜`,`\\~`),I(R,z,ad,`ˉ`,`\\=`),I(R,z,ad,`˘`,`\\u`),I(R,z,ad,`˙`,`\\.`),I(R,z,ad,`¸`,`\\c`),I(R,z,ad,`˚`,`\\r`),I(R,z,ad,`ˇ`,`\\v`),I(R,z,ad,`¨`,`\\"`),I(R,z,ad,`˝`,`\\H`),I(R,z,ad,`◯`,`\\textcircled`);var fd={"--":!0,"---":!0,"``":!0,"''":!0};I(R,z,W,`–`,`--`,!0),I(R,z,W,`–`,`\\textendash`),I(R,z,W,`—`,`---`,!0),I(R,z,W,`—`,`\\textemdash`),I(R,z,W,`‘`,"`",!0),I(R,z,W,`‘`,`\\textquoteleft`),I(R,z,W,`’`,`'`,!0),I(R,z,W,`’`,`\\textquoteright`),I(R,z,W,`“`,"``",!0),I(R,z,W,`“`,`\\textquotedblleft`),I(R,z,W,`”`,`''`,!0),I(R,z,W,`”`,`\\textquotedblright`),I(L,z,W,`°`,`\\degree`,!0),I(R,z,W,`°`,`\\degree`),I(R,z,W,`°`,`\\textdegree`,!0),I(L,z,W,`£`,`\\pounds`),I(L,z,W,`£`,`\\mathsterling`,!0),I(R,z,W,`£`,`\\pounds`),I(R,z,W,`£`,`\\textsterling`,!0),I(L,B,W,`✠`,`\\maltese`),I(R,B,W,`✠`,`\\maltese`);for(var pd=`0123456789/@."`,md=0;md<pd.length;md++){var hd=pd.charAt(md);I(L,z,W,hd,hd)}for(var gd=`0123456789!@*()-=+";:?/.,`,_d=0;_d<gd.length;_d++){var vd=gd.charAt(_d);I(R,z,W,vd,vd)}for(var yd=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,bd=0;bd<yd.length;bd++){var xd=yd.charAt(bd);I(L,z,H,xd,xd),I(R,z,W,xd,xd)}I(L,B,W,`C`,`ℂ`),I(R,B,W,`C`,`ℂ`),I(L,B,W,`H`,`ℍ`),I(R,B,W,`H`,`ℍ`),I(L,B,W,`N`,`ℕ`),I(R,B,W,`N`,`ℕ`),I(L,B,W,`P`,`ℙ`),I(R,B,W,`P`,`ℙ`),I(L,B,W,`Q`,`ℚ`),I(R,B,W,`Q`,`ℚ`),I(L,B,W,`R`,`ℝ`),I(R,B,W,`R`,`ℝ`),I(L,B,W,`Z`,`ℤ`),I(R,B,W,`Z`,`ℤ`),I(L,z,H,`h`,`ℎ`),I(R,z,H,`h`,`ℎ`);for(var G,Sd=0;Sd<yd.length;Sd++){var Cd=yd.charAt(Sd);G=String.fromCharCode(55349,56320+Sd),I(L,z,H,Cd,G),I(R,z,W,Cd,G),G=String.fromCharCode(55349,56372+Sd),I(L,z,H,Cd,G),I(R,z,W,Cd,G),G=String.fromCharCode(55349,56424+Sd),I(L,z,H,Cd,G),I(R,z,W,Cd,G),G=String.fromCharCode(55349,56580+Sd),I(L,z,H,Cd,G),I(R,z,W,Cd,G),G=String.fromCharCode(55349,56684+Sd),I(L,z,H,Cd,G),I(R,z,W,Cd,G),G=String.fromCharCode(55349,56736+Sd),I(L,z,H,Cd,G),I(R,z,W,Cd,G),G=String.fromCharCode(55349,56788+Sd),I(L,z,H,Cd,G),I(R,z,W,Cd,G),G=String.fromCharCode(55349,56840+Sd),I(L,z,H,Cd,G),I(R,z,W,Cd,G),G=String.fromCharCode(55349,56944+Sd),I(L,z,H,Cd,G),I(R,z,W,Cd,G),Sd<26&&(G=String.fromCharCode(55349,56632+Sd),I(L,z,H,Cd,G),I(R,z,W,Cd,G),G=String.fromCharCode(55349,56476+Sd),I(L,z,H,Cd,G),I(R,z,W,Cd,G))}G=String.fromCharCode(55349,56668),I(L,z,H,`k`,G),I(R,z,W,`k`,G);for(var wd=0;wd<10;wd++){var Td=wd.toString();G=String.fromCharCode(55349,57294+wd),I(L,z,H,Td,G),I(R,z,W,Td,G),G=String.fromCharCode(55349,57314+wd),I(L,z,H,Td,G),I(R,z,W,Td,G),G=String.fromCharCode(55349,57324+wd),I(L,z,H,Td,G),I(R,z,W,Td,G),G=String.fromCharCode(55349,57334+wd),I(L,z,H,Td,G),I(R,z,W,Td,G)}for(var Ed=`ÐÞþ`,Dd=0;Dd<Ed.length;Dd++){var Od=Ed.charAt(Dd);I(L,z,H,Od,Od),I(R,z,W,Od,Od)}var kd={mathClass:`mathbf`,textClass:`textbf`,font:`Main-Bold`},Ad={mathClass:`mathnormal`,textClass:`textit`,font:`Math-Italic`},jd={mathClass:`boldsymbol`,textClass:`boldsymbol`,font:`Main-BoldItalic`},Md={mathClass:`mathscr`,textClass:`textscr`,font:`Script-Regular`},Nd={mathClass:``,textClass:``,font:``},Pd={mathClass:`mathfrak`,textClass:`textfrak`,font:`Fraktur-Regular`},Fd={mathClass:`mathbb`,textClass:`textbb`,font:`AMS-Regular`},Id={mathClass:`mathboldfrak`,textClass:`textboldfrak`,font:`Fraktur-Regular`},Ld={mathClass:`mathsf`,textClass:`textsf`,font:`SansSerif-Regular`},Rd={mathClass:`mathboldsf`,textClass:`textboldsf`,font:`SansSerif-Bold`},zd={mathClass:`mathitsf`,textClass:`textitsf`,font:`SansSerif-Italic`},Bd={mathClass:`mathtt`,textClass:`texttt`,font:`Typewriter-Regular`},Vd=[kd,kd,Ad,Ad,jd,jd,Md,Nd,Nd,Nd,Pd,Pd,Fd,Fd,Id,Id,Ld,Ld,Rd,Rd,zd,zd,Nd,Nd,Bd,Bd],Hd=[kd,Nd,Ld,Rd,Bd],Ud=e=>{var t=e.charCodeAt(0),n=e.charCodeAt(1),r=(t-55296)*1024+(n-56320)+65536;if(119808<=r&&r<120484)return Vd[Math.floor((r-119808)/26)];if(120782<=r&&r<=120831)return Hd[Math.floor((r-120782)/10)];if(r===120485||r===120486)return Vd[0];if(120486<r&&r<120782)return Nd;throw new N(`Unsupported character: `+e)},Wd=function(e,t,n){if(id[n][e]){var r=id[n][e].replace;r&&(e=r)}return{value:e,metrics:td(e,t,n)}},Gd=function(e,t,n,r,i){var a=Wd(e,t,n),o=a.metrics;e=a.value;var s;if(o){var c=o.italic;(n===`text`||r&&r.font===`mathit`)&&(c=0),s=new Wu(e,o.height,o.depth,c,o.skew,o.width,i)}else typeof console<`u`&&console.warn(`No character metrics `+(`for '`+e+`' in style '`+t+`' and mode '`+n+`'`)),s=new Wu(e,0,0,0,0,0,i);if(r){s.maxFontSize=r.sizeMultiplier,r.style.isTight()&&s.classes.push(`mtight`);var l=r.getColor();l&&(s.style.color=l)}return s},Kd=function(e,t,n,r){return r===void 0&&(r=[]),n.font===`boldsymbol`&&Wd(e,`Main-Bold`,t).metrics?Gd(e,`Main-Bold`,t,n,r.concat([`mathbf`])):e===`\\`||id[t][e].font===`main`?Gd(e,`Main-Regular`,t,n,r):Gd(e,`AMS-Regular`,t,n,r.concat([`amsrm`]))},qd=function(e,t,n){return n!==`textord`&&Wd(e,`Math-BoldItalic`,t).metrics?{fontName:`Math-BoldItalic`,fontClass:`boldsymbol`}:{fontName:`Main-Bold`,fontClass:`mathbf`}},Jd=function(e,t,n){var r=e.mode,i=e.text,a=[`mord`],{font:o,fontFamily:s,fontWeight:c,fontShape:l}=t,u=r===`math`||r===`text`&&!!o,d=u?o:s,f=``,p=``;if(i.charCodeAt(0)===55349){var m=Ud(i);f=m.font,p=m[r+`Class`]}if(f)return Gd(i,f,r,t,a.concat(p));if(d){var h,g;if(d===`boldsymbol`){var _=qd(i,r,n);h=_.fontName,g=[_.fontClass]}else u?(h=cf[o].fontName,g=[o]):(h=sf(s,c,l),g=[s,c,l]);if(Wd(i,h,r).metrics)return Gd(i,h,r,t,a.concat(g));if(fd.hasOwnProperty(i)&&h.slice(0,10)===`Typewriter`){for(var v=[],y=0;y<i.length;y++)v.push(Gd(i[y],h,r,t,a.concat(g)));return tf(v)}}if(n===`mathord`)return Gd(i,`Math-Italic`,r,t,a.concat([`mathnormal`]));if(n===`textord`){var b=id[r][i]&&id[r][i].font;if(b===`ams`)return Gd(i,sf(`amsrm`,c,l),r,t,a.concat(`amsrm`,c,l));if(b===`main`||!b)return Gd(i,sf(`textrm`,c,l),r,t,a.concat(c,l));var x=sf(b,c,l);return Gd(i,x,r,t,a.concat(x,c,l))}else throw Error(`unexpected type: `+n+` in makeOrd`)},Yd=(e,t)=>{if(Pu(e.classes)!==Pu(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||e.italic!==0&&e.hasClass(`mathnormal`))return!1;if(e.classes.length===1){var n=e.classes[0];if(n===`mbin`||n===`mord`)return!1}for(var r of Object.keys(e.style))if(e.style[r]!==t.style[r])return!1;for(var i of Object.keys(t.style))if(e.style[i]!==t.style[i])return!1;return!0},Xd=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof Wu&&r instanceof Wu&&Yd(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--)}return e},Zd=function(e){for(var t=0,n=0,r=0,i=0;i<e.children.length;i++){var a=e.children[i];a.height>t&&(t=a.height),a.depth>n&&(n=a.depth),a.maxFontSize>r&&(r=a.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},K=function(e,t,n,r){var i=new Bu(e,t,n,r);return Zd(i),i},Qd=(e,t,n,r)=>new Bu(e,t,n,r),$d=function(e,t,n){var r=K([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=F(r.height),r.maxFontSize=1,r},ef=function(e,t,n,r){var i=new Vu(e,t,n,r);return Zd(i),i},tf=function(e){var t=new ku(e);return Zd(t),t},nf=function(e,t){return e instanceof ku?K([],[e],t):e},rf=function(e){if(e.positionType===`individualShift`){for(var t=e.children,n=[t[0]],r=-t[0].shift-t[0].elem.depth,i=r,a=1;a<t.length;a++){var o=-t[a].shift-i-t[a].elem.depth,s=o-(t[a-1].elem.height+t[a-1].elem.depth);i+=o,n.push({type:`kern`,size:s}),n.push(t[a])}return{children:n,depth:r}}var c;if(e.positionType===`top`){for(var l=e.positionData,u=0;u<e.children.length;u++){var d=e.children[u];l-=d.type===`kern`?d.size:d.elem.height+d.elem.depth}c=l}else if(e.positionType===`bottom`)c=-e.positionData;else{var f=e.children[0];if(f.type!==`elem`)throw Error(`First child must have type "elem".`);if(e.positionType===`shift`)c=-f.elem.depth-e.positionData;else if(e.positionType===`firstBaseline`)c=-f.elem.depth;else throw Error(`Invalid positionType `+e.positionType+`.`)}return{children:e.children,depth:c}},af=function(e,t){for(var{children:n,depth:r}=rf(e),i=0,a=0;a<n.length;a++){var o=n[a];if(o.type===`elem`){var s=o.elem;i=Math.max(i,s.maxFontSize,s.height)}}i+=2;var c=K([`pstrut`],[]);c.style.height=F(i);for(var l=[],u=r,d=r,f=r,p=0;p<n.length;p++){var m=n[p];if(m.type===`kern`)f+=m.size;else{var h=m.elem,g=m.wrapperClasses||[],_=m.wrapperStyle||{},v=K(g,[c,h],void 0,_);v.style.top=F(-i-f-h.depth),m.marginLeft&&(v.style.marginLeft=m.marginLeft),m.marginRight&&(v.style.marginRight=m.marginRight),l.push(v),f+=h.height+h.depth}u=Math.min(u,f),d=Math.max(d,f)}var y=K([`vlist`],l);y.style.height=F(d);var b;if(u<0){var x=K([`vlist`],[K([],[])]);x.style.height=F(-u),b=[K([`vlist-r`],[y,K([`vlist-s`],[new Wu(``)])]),K([`vlist-r`],[x])]}else b=[K([`vlist-r`],[y])];var S=K([`vlist-t`],b);return b.length===2&&S.classes.push(`vlist-t2`),S.height=d,S.depth=-u,S},of=(e,t)=>{var n=K([`mspace`],[],t),r=Nu(e,t);return n.style.marginRight=F(r),n},sf=(e,t,n)=>{var r,i;switch(e){case`amsrm`:r=`AMS`;break;case`textrm`:r=`Main`;break;case`textsf`:r=`SansSerif`;break;case`texttt`:r=`Typewriter`;break;default:r=e}return i=t===`textbf`&&n===`textit`?`BoldItalic`:t===`textbf`?`Bold`:n===`textit`?`Italic`:`Regular`,r+`-`+i},cf={mathbf:{variant:`bold`,fontName:`Main-Bold`},mathrm:{variant:`normal`,fontName:`Main-Regular`},textit:{variant:`italic`,fontName:`Main-Italic`},mathit:{variant:`italic`,fontName:`Main-Italic`},mathnormal:{variant:`italic`,fontName:`Math-Italic`},mathsfit:{variant:`sans-serif-italic`,fontName:`SansSerif-Italic`},mathbb:{variant:`double-struck`,fontName:`AMS-Regular`},mathcal:{variant:`script`,fontName:`Caligraphic-Regular`},mathfrak:{variant:`fraktur`,fontName:`Fraktur-Regular`},mathscr:{variant:`script`,fontName:`Script-Regular`},mathsf:{variant:`sans-serif`,fontName:`SansSerif-Regular`},mathtt:{variant:`monospace`,fontName:`Typewriter-Regular`}},lf={vec:[`vec`,.471,.714],oiintSize1:[`oiintSize1`,.957,.499],oiintSize2:[`oiintSize2`,1.472,.659],oiiintSize1:[`oiiintSize1`,1.304,.499],oiiintSize2:[`oiiintSize2`,1.98,.659]},uf=function(e,t){var[n,r,i]=lf[e],a=Qd([`overlay`],[new Gu([new Ku(n)],{width:F(r),height:F(i),style:`width:`+F(r),viewBox:`0 0 `+1e3*r+` `+1e3*i,preserveAspectRatio:`xMinYMin`})],t);return a.height=i,a.style.height=F(i),a.style.width=F(r),a},df={number:3,unit:`mu`},ff={number:4,unit:`mu`},pf={number:5,unit:`mu`},mf={mord:{mop:df,mbin:ff,mrel:pf,minner:df},mop:{mord:df,mop:df,mrel:pf,minner:df},mbin:{mord:ff,mop:ff,mopen:ff,minner:ff},mrel:{mord:pf,mop:pf,mopen:pf,minner:pf},mopen:{},mclose:{mop:df,mbin:ff,mrel:pf,minner:df},mpunct:{mord:df,mop:df,mrel:pf,mopen:df,mclose:df,mpunct:df,minner:df},minner:{mord:df,mop:df,mbin:ff,mrel:pf,mopen:df,mpunct:df,minner:df}},hf={mord:{mop:df},mop:{mord:df,mop:df},mbin:{},mrel:{},mopen:{},mclose:{mop:df},mpunct:{},minner:{mop:df}},gf={},_f={},vf={};function q(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:o}=e,s={type:t,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:i},c=0;c<n.length;++c)gf[n[c]]=s;t&&(a&&(_f[t]=a),o&&(vf[t]=o))}function yf(e){var{type:t,htmlBuilder:n,mathmlBuilder:r}=e;q({type:t,names:[],props:{numArgs:0},handler(){throw Error(`Should never be called.`)},htmlBuilder:n,mathmlBuilder:r})}var bf=function(e){return e.type===`ordgroup`&&e.body.length===1?e.body[0]:e},xf=function(e){return e.type===`ordgroup`?e.body:[e]},Sf=new Set([`leftmost`,`mbin`,`mopen`,`mrel`,`mop`,`mpunct`]),Cf=new Set([`rightmost`,`mrel`,`mclose`,`mpunct`]),wf={display:P.DISPLAY,text:P.TEXT,script:P.SCRIPT,scriptscript:P.SCRIPTSCRIPT},Tf={mord:`mord`,mop:`mop`,mbin:`mbin`,mrel:`mrel`,mopen:`mopen`,mclose:`mclose`,mpunct:`mpunct`,minner:`minner`},Ef=function(e,t,n,r){r===void 0&&(r=[null,null]);for(var i=[],a=0;a<e.length;a++){var o=Mf(e[a],t);if(o instanceof ku){var s=o.children;i.push(...s)}else i.push(o)}if(Xd(i),!n)return i;var c=t;if(e.length===1){var l=e[0];l.type===`sizing`?c=t.havingSize(l.size):l.type===`styling`&&(c=t.havingStyle(wf[l.style]))}var u=K([r[0]||`leftmost`],[],t),d=K([r[1]||`rightmost`],[],t),f=n===`root`;return Df(i,(e,t)=>{var n=t.classes[0],r=e.classes[0];n===`mbin`&&Cf.has(r)?t.classes[0]=`mord`:r===`mbin`&&Sf.has(n)&&(e.classes[0]=`mord`)},{node:u},d,f),Df(i,(e,t)=>{var n=Af(t),r=Af(e),i=n&&r?e.hasClass(`mtight`)?hf[n]?.[r]:mf[n]?.[r]:null;if(i)return of(i,c)},{node:u},d,f),i},Df=function(e,t,n,r,i){r&&e.push(r);for(var a=0;a<e.length;a++){var o=e[a],s=Of(o);if(s){Df(s.children,t,n,null,i);continue}var c=!o.hasClass(`mspace`);if(c){var l=t(o,n.node);l&&(n.insertAfter?n.insertAfter(l):(e.unshift(l),a++))}c?n.node=o:i&&o.hasClass(`newline`)&&(n.node=K([`leftmost`])),n.insertAfter=(t=>n=>{e.splice(t+1,0,n),a++})(a)}r&&e.pop()},Of=function(e){return e instanceof ku||e instanceof Vu||e instanceof Bu&&e.hasClass(`enclosing`)?e:null},kf=function(e,t){var n=Of(e);if(n){var r=n.children;if(r.length){if(t===`right`)return kf(r[r.length-1],`right`);if(t===`left`)return kf(r[0],`left`)}}return e},Af=function(e,t){return e?(t&&(e=kf(e,t)),Tf[e.classes[0]]||null):null},jf=function(e,t){var n=[`nulldelimiter`].concat(e.baseSizingClasses());return K(t.concat(n))},Mf=function(e,t,n){if(!e)return K();if(_f[e.type]){var r=_f[e.type](e,t);if(n&&t.size!==n.size){r=K(t.sizingClasses(n),[r],t);var i=t.sizeMultiplier/n.sizeMultiplier;r.height*=i,r.depth*=i}return r}else throw new N(`Got group of unknown type: '`+e.type+`'`)};function Nf(e,t){var n=K([`base`],e,t),r=K([`strut`]);return r.style.height=F(n.height+n.depth),n.depth&&(r.style.verticalAlign=F(-n.depth)),n.children.unshift(r),n}function Pf(e,t){var n=null;e.length===1&&e[0].type===`tag`&&(n=e[0].tag,e=e[0].body);var r=Ef(e,t,`root`),i;r.length===2&&r[1].hasClass(`tag`)&&(i=r.pop());for(var a=[],o=[],s=0;s<r.length;s++)if(o.push(r[s]),r[s].hasClass(`mbin`)||r[s].hasClass(`mrel`)||r[s].hasClass(`allowbreak`)){for(var c=!1;s<r.length-1&&r[s+1].hasClass(`mspace`)&&!r[s+1].hasClass(`newline`);)s++,o.push(r[s]),r[s].hasClass(`nobreak`)&&(c=!0);c||(a.push(Nf(o,t)),o=[])}else r[s].hasClass(`newline`)&&(o.pop(),o.length>0&&(a.push(Nf(o,t)),o=[]),a.push(r[s]));o.length>0&&a.push(Nf(o,t));var l;n?(l=Nf(Ef(n,t,!0),t),l.classes=[`tag`],a.push(l)):i&&a.push(i);var u=K([`katex-html`],a);if(u.setAttribute(`aria-hidden`,`true`),l){var d=l.children[0];d.style.height=F(u.height+u.depth),u.depth&&(d.style.verticalAlign=F(-u.depth))}return u}function Ff(e){return new ku(e)}var J=class{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=Pu(this.classes));for(var n=0;n<this.children.length;n++)if(this.children[n]instanceof If&&this.children[n+1]instanceof If){for(var r=this.children[n].toText()+this.children[++n].toText();this.children[n+1]instanceof If;)r+=this.children[++n].toText();e.appendChild(new If(r).toNode())}else e.appendChild(this.children[n].toNode());return e}toMarkup(){var e=`<`+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=` `+t+`="`,e+=zl(this.attributes[t]),e+=`"`);this.classes.length>0&&(e+=` class ="`+zl(Pu(this.classes))+`"`),e+=`>`;for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+=`</`+this.type+`>`,e}toText(){return this.children.map(e=>e.toText()).join(``)}},If=class{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return zl(this.toText())}toText(){return this.text}},Lf=class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=` `:e>=.1666&&e<=.1667?this.character=` `:e>=.2222&&e<=.2223?this.character=` `:e>=.2777&&e<=.2778?this.character=` `:e>=-.05556&&e<=-.05555?this.character=` `:e>=-.1667&&e<=-.1666?this.character=` `:e>=-.2223&&e<=-.2222?this.character=` `:e>=-.2778&&e<=-.2777?this.character=` `:this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`mspace`);return e.setAttribute(`width`,F(this.width)),e}toMarkup(){return this.character?`<mtext>`+this.character+`</mtext>`:`<mspace width="`+F(this.width)+`"/>`}toText(){return this.character?this.character:` `}},Rf=new Set([`\\imath`,`\\jmath`]),zf=new Set([`mrow`,`mtable`]),Bf=function(e,t,n){return id[t][e]&&id[t][e].replace&&e.charCodeAt(0)!==55349&&!(fd.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)===`tt`||n.font&&n.font.slice(4,6)===`tt`))&&(e=id[t][e].replace),new If(e)},Vf=function(e){return e.length===1?e[0]:new J(`mrow`,e)},Hf={mathit:`italic`,boldsymbol:e=>e.type===`textord`?`bold`:`bold-italic`,mathbf:`bold`,mathbb:`double-struck`,mathsfit:`sans-serif-italic`,mathfrak:`fraktur`,mathscr:`script`,mathcal:`script`,mathsf:`sans-serif`,mathtt:`monospace`},Uf=(e,t)=>{if(e.mode===`text`){if(t.fontFamily===`texttt`)return`monospace`;if(t.fontFamily===`textsf`)return t.fontShape===`textit`&&t.fontWeight===`textbf`?`sans-serif-bold-italic`:t.fontShape===`textit`?`sans-serif-italic`:t.fontWeight===`textbf`?`bold-sans-serif`:`sans-serif`;if(t.fontShape===`textit`&&t.fontWeight===`textbf`)return`bold-italic`;if(t.fontShape===`textit`)return`italic`;if(t.fontWeight===`textbf`)return`bold`}var n=t.font;if(!n||n===`mathnormal`)return null;var r=e.mode,i=Hf[n];if(i)return typeof i==`function`?i(e):i;var a=e.text;if(Rf.has(a))return null;if(id[r][a]){var o=id[r][a].replace;o&&(a=o)}var s=cf[n].fontName;return td(a,s,r)?cf[n].variant:null};function Wf(e){if(!e)return!1;if(e.type===`mi`&&e.children.length===1){var t=e.children[0];return t instanceof If&&t.text===`.`}else if(e.type===`mo`&&e.children.length===1&&e.getAttribute(`separator`)===`true`&&e.getAttribute(`lspace`)===`0em`&&e.getAttribute(`rspace`)===`0em`){var n=e.children[0];return n instanceof If&&n.text===`,`}else return!1}var Gf=function(e,t,n){if(e.length===1){var r=qf(e[0],t);return n&&r instanceof J&&r.type===`mo`&&(r.setAttribute(`lspace`,`0em`),r.setAttribute(`rspace`,`0em`)),[r]}for(var i=[],a,o=0;o<e.length;o++){var s=qf(e[o],t);if(s instanceof J&&a instanceof J){if(s.type===`mtext`&&a.type===`mtext`&&s.getAttribute(`mathvariant`)===a.getAttribute(`mathvariant`)){a.children.push(...s.children);continue}else if(s.type===`mn`&&a.type===`mn`){a.children.push(...s.children);continue}else if(Wf(s)&&a.type===`mn`){a.children.push(...s.children);continue}else if(s.type===`mn`&&Wf(a))s.children=[...a.children,...s.children],i.pop();else if((s.type===`msup`||s.type===`msub`)&&s.children.length>=1&&(a.type===`mn`||Wf(a))){var c=s.children[0];c instanceof J&&c.type===`mn`&&(c.children=[...a.children,...c.children],i.pop())}else if(a.type===`mi`&&a.children.length===1){var l=a.children[0];if(l instanceof If&&l.text===`̸`&&(s.type===`mo`||s.type===`mi`||s.type===`mn`)){var u=s.children[0];u instanceof If&&u.text.length>0&&(u.text=u.text.slice(0,1)+`̸`+u.text.slice(1),i.pop())}}}i.push(s),a=s}return i},Kf=function(e,t,n){return Vf(Gf(e,t,n))},qf=function(e,t){if(!e)return new J(`mrow`);if(vf[e.type])return vf[e.type](e,t);throw new N(`Got group of unknown type: '`+e.type+`'`)};function Jf(e,t,n,r,i){var a=Gf(e,n),o=a.length===1&&a[0]instanceof J&&zf.has(a[0].type)?a[0]:new J(`mrow`,a),s=new J(`annotation`,[new If(t)]);s.setAttribute(`encoding`,`application/x-tex`);var c=new J(`math`,[new J(`semantics`,[o,s])]);return c.setAttribute(`xmlns`,`http://www.w3.org/1998/Math/MathML`),r&&c.setAttribute(`display`,`block`),K([i?`katex`:`katex-mathml`],[c])}var Yf=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],Xf=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Zf=function(e,t){return t.size<2?e:Yf[e-1][t.size-1]},Qf=class e{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||e.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||``,this.fontFamily=t.fontFamily||``,this.fontWeight=t.fontWeight||``,this.fontShape=t.fontShape||``,this.sizeMultiplier=Xf[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(n,t),new e(n)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:Zf(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:Xf[e-1]})}havingBaseStyle(t){t||=this.style.text();var n=Zf(e.BASESIZE,t);return this.size===n&&this.textSize===e.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:``})}withTextFontWeight(e){return this.extend({fontWeight:e,font:``})}withTextFontShape(e){return this.extend({fontShape:e,font:``})}sizingClasses(e){return e.size===this.size?[]:[`sizing`,`reset-size`+e.size,`size`+this.size]}baseSizingClasses(){return this.size===e.BASESIZE?[]:[`sizing`,`reset-size`+this.size,`size`+e.BASESIZE]}fontMetrics(){return this._fontMetrics||=rd(this.size),this._fontMetrics}getColor(){return this.phantom?`transparent`:this.color}};Qf.BASESIZE=6;var $f=function(e){return new Qf({style:e.displayMode?P.DISPLAY:P.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},ep=function(e,t){if(t.displayMode){var n=[`katex-display`];t.leqno&&n.push(`leqno`),t.fleqn&&n.push(`fleqn`),e=K(n,[e])}return e},tp=function(e,t,n){var r=$f(n),i;return n.output===`mathml`?Jf(e,t,r,n.displayMode,!0):(i=n.output===`html`?K([`katex`],[Pf(e,r)]):K([`katex`],[Jf(e,t,r,n.displayMode,!1),Pf(e,r)]),ep(i,n))},np=function(e,t,n){return ep(K([`katex`],[Pf(e,$f(n))]),n)},rp={widehat:`^`,widecheck:`ˇ`,widetilde:`~`,utilde:`~`,overleftarrow:`←`,underleftarrow:`←`,xleftarrow:`←`,overrightarrow:`→`,underrightarrow:`→`,xrightarrow:`→`,underbrace:`⏟`,overbrace:`⏞`,underbracket:`⎵`,overbracket:`⎴`,overgroup:`⏠`,undergroup:`⏡`,overleftrightarrow:`↔`,underleftrightarrow:`↔`,xleftrightarrow:`↔`,Overrightarrow:`⇒`,xRightarrow:`⇒`,overleftharpoon:`↼`,xleftharpoonup:`↼`,overrightharpoon:`⇀`,xrightharpoonup:`⇀`,xLeftarrow:`⇐`,xLeftrightarrow:`⇔`,xhookleftarrow:`↩`,xhookrightarrow:`↪`,xmapsto:`↦`,xrightharpoondown:`⇁`,xleftharpoondown:`↽`,xrightleftharpoons:`⇌`,xleftrightharpoons:`⇋`,xtwoheadleftarrow:`↞`,xtwoheadrightarrow:`↠`,xlongequal:`=`,xtofrom:`⇄`,xrightleftarrows:`⇄`,xrightequilibrium:`⇌`,xleftequilibrium:`⇋`,"\\cdrightarrow":`→`,"\\cdleftarrow":`←`,"\\cdlongequal":`=`},ip=function(e){var t=new J(`mo`,[new If(rp[e.replace(/^\\/,``)])]);return t.setAttribute(`stretchy`,`true`),t},ap={overrightarrow:[[`rightarrow`],.888,522,`xMaxYMin`],overleftarrow:[[`leftarrow`],.888,522,`xMinYMin`],underrightarrow:[[`rightarrow`],.888,522,`xMaxYMin`],underleftarrow:[[`leftarrow`],.888,522,`xMinYMin`],xrightarrow:[[`rightarrow`],1.469,522,`xMaxYMin`],"\\cdrightarrow":[[`rightarrow`],3,522,`xMaxYMin`],xleftarrow:[[`leftarrow`],1.469,522,`xMinYMin`],"\\cdleftarrow":[[`leftarrow`],3,522,`xMinYMin`],Overrightarrow:[[`doublerightarrow`],.888,560,`xMaxYMin`],xRightarrow:[[`doublerightarrow`],1.526,560,`xMaxYMin`],xLeftarrow:[[`doubleleftarrow`],1.526,560,`xMinYMin`],overleftharpoon:[[`leftharpoon`],.888,522,`xMinYMin`],xleftharpoonup:[[`leftharpoon`],.888,522,`xMinYMin`],xleftharpoondown:[[`leftharpoondown`],.888,522,`xMinYMin`],overrightharpoon:[[`rightharpoon`],.888,522,`xMaxYMin`],xrightharpoonup:[[`rightharpoon`],.888,522,`xMaxYMin`],xrightharpoondown:[[`rightharpoondown`],.888,522,`xMaxYMin`],xlongequal:[[`longequal`],.888,334,`xMinYMin`],"\\cdlongequal":[[`longequal`],3,334,`xMinYMin`],xtwoheadleftarrow:[[`twoheadleftarrow`],.888,334,`xMinYMin`],xtwoheadrightarrow:[[`twoheadrightarrow`],.888,334,`xMaxYMin`],overleftrightarrow:[[`leftarrow`,`rightarrow`],.888,522],overbrace:[[`leftbrace`,`midbrace`,`rightbrace`],1.6,548],underbrace:[[`leftbraceunder`,`midbraceunder`,`rightbraceunder`],1.6,548],underleftrightarrow:[[`leftarrow`,`rightarrow`],.888,522],xleftrightarrow:[[`leftarrow`,`rightarrow`],1.75,522],xLeftrightarrow:[[`doubleleftarrow`,`doublerightarrow`],1.75,560],xrightleftharpoons:[[`leftharpoondownplus`,`rightharpoonplus`],1.75,716],xleftrightharpoons:[[`leftharpoonplus`,`rightharpoondownplus`],1.75,716],xhookleftarrow:[[`leftarrow`,`righthook`],1.08,522],xhookrightarrow:[[`lefthook`,`rightarrow`],1.08,522],overlinesegment:[[`leftlinesegment`,`rightlinesegment`],.888,522],underlinesegment:[[`leftlinesegment`,`rightlinesegment`],.888,522],overbracket:[[`leftbracketover`,`rightbracketover`],1.6,440],underbracket:[[`leftbracketunder`,`rightbracketunder`],1.6,410],overgroup:[[`leftgroup`,`rightgroup`],.888,342],undergroup:[[`leftgroupunder`,`rightgroupunder`],.888,342],xmapsto:[[`leftmapsto`,`rightarrow`],1.5,522],xtofrom:[[`leftToFrom`,`rightToFrom`],1.75,528],xrightleftarrows:[[`baraboveleftarrow`,`rightarrowabovebar`],1.75,901],xrightequilibrium:[[`baraboveshortleftharpoon`,`rightharpoonaboveshortbar`],1.75,716],xleftequilibrium:[[`shortbaraboveleftharpoon`,`shortrightharpoonabovebar`],1.75,716]},op=new Set([`widehat`,`widecheck`,`widetilde`,`utilde`]),sp=function(e,t){function n(){var n=4e5,r=e.label.slice(1);if(op.has(r)&&`base`in e){var i=e.base.type===`ordgroup`?e.base.body.length:1,a,o,s;if(i>5)r===`widehat`||r===`widecheck`?(a=420,n=2364,s=.42,o=r+`4`):(a=312,n=2340,s=.34,o=`tilde4`);else{var c=[1,1,2,2,3,3][i];r===`widehat`||r===`widecheck`?(n=[0,1062,2364,2364,2364][c],a=[0,239,300,360,420][c],s=[0,.24,.3,.3,.36,.42][c],o=r+c):(n=[0,600,1033,2339,2340][c],a=[0,260,286,306,312][c],s=[0,.26,.286,.3,.306,.34][c],o=`tilde`+c)}return{span:Qd([],[new Gu([new Ku(o)],{width:`100%`,height:F(s),viewBox:`0 0 `+n+` `+a,preserveAspectRatio:`none`})],t),minWidth:0,height:s}}else{var l=[],u=ap[r];if(!u)throw Error(`No SVG data for "`+r+`".`);var[d,f,p]=u,m=p/1e3,h=d.length,g,_;if(h===1){if(u.length!==4)throw Error(`Expected 4-tuple for single-path SVG data "`+r+`".`);g=[`hide-tail`],_=[u[3]]}else if(h===2)g=[`halfarrow-left`,`halfarrow-right`],_=[`xMinYMin`,`xMaxYMin`];else if(h===3)g=[`brace-left`,`brace-center`,`brace-right`],_=[`xMinYMin`,`xMidYMin`,`xMaxYMin`];else throw Error(`Correct katexImagesData or update code here to support
|
|
296
|
-
`+h+` children.`);for(var v=0;v<h;v++){var y=new Gu([new Ku(d[v])],{width:`400em`,height:F(m),viewBox:`0 0 `+n+` `+p,preserveAspectRatio:_[v]+` slice`}),b=Qd([g[v]],[y],t);if(h===1)return{span:b,minWidth:f,height:m};b.style.height=F(m),l.push(b)}return{span:K([`stretchy`],l,t),minWidth:f,height:m}}}var{span:r,minWidth:i,height:a}=n();return r.height=a,r.style.height=F(a),i>0&&(r.style.minWidth=F(i)),r},cp=function(e,t,n,r,i){var a,o=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(a=K([`stretchy`,t],[],i),t===`fbox`){var s=i.color&&i.getColor();s&&(a.style.borderColor=s)}}else{var c=[];/^[bx]cancel$/.test(t)&&c.push(new qu({x1:`0`,y1:`0`,x2:`100%`,y2:`100%`,"stroke-width":`0.046em`})),/^x?cancel$/.test(t)&&c.push(new qu({x1:`0`,y1:`100%`,x2:`100%`,y2:`0`,"stroke-width":`0.046em`})),a=Qd([],[new Gu(c,{width:`100%`,height:F(o)})],i)}return a.height=o,a.style.height=F(o),a},lp={bin:1,close:1,inner:1,open:1,punct:1,rel:1},up={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function dp(e){return e in lp}function Y(e,t){if(!e||e.type!==t)throw Error(`Expected node of type `+t+`, but got `+(e?`node of type `+e.type:String(e)));return e}function fp(e){var t=pp(e);if(!t)throw Error(`Expected node of symbol group type, but got `+(e?`node of type `+e.type:String(e)));return t}function pp(e){return e&&(e.type===`atom`||up.hasOwnProperty(e.type))?e:null}var mp=e=>{if(e instanceof Wu)return e;if(Xu(e)&&e.children.length===1)return mp(e.children[0])},hp=(e,t)=>{var n,r,i;e&&e.type===`supsub`?(r=Y(e.base,`accent`),n=r.base,e.base=n,i=Yu(Mf(e,t)),e.base=r):(r=Y(e,`accent`),n=r.base);var a=Mf(n,t.havingCrampedStyle()),o=r.isShifty&&Hl(n),s=0;o&&(s=mp(a)?.skew??0);var c=r.label===`\\c`,l=c?a.height+a.depth:Math.min(a.height,t.fontMetrics().xHeight),u;if(r.isStretchy)u=sp(r,t),u=af({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`elem`,elem:u,wrapperClasses:[`svg-align`],wrapperStyle:s>0?{width:`calc(100% - `+F(2*s)+`)`,marginLeft:F(2*s)}:void 0}]});else{var d,f;r.label===`\\vec`?(d=uf(`vec`,t),f=lf.vec[1]):(d=Jd({type:`textord`,mode:r.mode,text:r.label},t,`textord`),d=Ju(d),d.italic=0,f=d.width,c&&(l+=d.depth)),u=K([`accent-body`],[d]);var p=r.label===`\\textcircled`;p&&(u.classes.push(`accent-full`),l=a.height);var m=s;p||(m-=f/2),u.style.left=F(m),r.label===`\\textcircled`&&(u.style.top=`.2em`),u=af({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:-l},{type:`elem`,elem:u}]})}var h=K([`mord`,`accent`],[u],t);return i?(i.children[0]=h,i.height=Math.max(h.height,i.height),i.classes[0]=`mord`,i):h},gp=(e,t)=>{var n=e.isStretchy?ip(e.label):new J(`mo`,[Bf(e.label,e.mode)]),r=new J(`mover`,[qf(e.base,t),n]);return r.setAttribute(`accent`,`true`),r},_p=new RegExp([`\\acute`,`\\grave`,`\\ddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`].map(e=>`\\`+e).join(`|`));q({type:`accent`,names:[`\\acute`,`\\grave`,`\\ddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`,`\\widecheck`,`\\widehat`,`\\widetilde`,`\\overrightarrow`,`\\overleftarrow`,`\\Overrightarrow`,`\\overleftrightarrow`,`\\overgroup`,`\\overlinesegment`,`\\overleftharpoon`,`\\overrightharpoon`],props:{numArgs:1},handler:(e,t)=>{var n=bf(t[0]),r=!_p.test(e.funcName),i=!r||e.funcName===`\\widehat`||e.funcName===`\\widetilde`||e.funcName===`\\widecheck`;return{type:`accent`,mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:hp,mathmlBuilder:gp}),q({type:`accent`,names:[`\\'`,"\\`",`\\^`,`\\~`,`\\=`,`\\u`,`\\.`,`\\"`,`\\c`,`\\r`,`\\H`,`\\v`,`\\textcircled`],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`primitive`]},handler:(e,t)=>{var n=t[0],r=e.parser.mode;return r===`math`&&(e.parser.settings.reportNonstrict(`mathVsTextAccents`,`LaTeX's accent `+e.funcName+` works only in text mode`),r=`text`),{type:`accent`,mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:hp,mathmlBuilder:gp}),q({type:`accentUnder`,names:[`\\underleftarrow`,`\\underrightarrow`,`\\underleftrightarrow`,`\\undergroup`,`\\underlinesegment`,`\\utilde`],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:`accentUnder`,mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=Mf(e.base,t),r=sp(e,t),i=e.label===`\\utilde`?.12:0;return K([`mord`,`accentunder`],[af({positionType:`top`,positionData:n.height,children:[{type:`elem`,elem:r,wrapperClasses:[`svg-align`]},{type:`kern`,size:i},{type:`elem`,elem:n}]})],t)},mathmlBuilder:(e,t)=>{var n=ip(e.label),r=new J(`munder`,[qf(e.base,t),n]);return r.setAttribute(`accentunder`,`true`),r}});var vp=e=>{var t=new J(`mpadded`,e?[e]:[]);return t.setAttribute(`width`,`+0.6em`),t.setAttribute(`lspace`,`0.3em`),t};q({type:`xArrow`,names:[`\\xleftarrow`,`\\xrightarrow`,`\\xLeftarrow`,`\\xRightarrow`,`\\xleftrightarrow`,`\\xLeftrightarrow`,`\\xhookleftarrow`,`\\xhookrightarrow`,`\\xmapsto`,`\\xrightharpoondown`,`\\xrightharpoonup`,`\\xleftharpoondown`,`\\xleftharpoonup`,`\\xrightleftharpoons`,`\\xleftrightharpoons`,`\\xlongequal`,`\\xtwoheadrightarrow`,`\\xtwoheadleftarrow`,`\\xtofrom`,`\\xrightleftarrows`,`\\xrightequilibrium`,`\\xleftequilibrium`,`\\\\cdrightarrow`,`\\\\cdleftarrow`,`\\\\cdlongequal`],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r,funcName:i}=e;return{type:`xArrow`,mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,r=t.havingStyle(n.sup()),i=nf(Mf(e.body,r,t),t),a=e.label.slice(0,2)===`\\x`?`x`:`cd`;i.classes.push(a+`-arrow-pad`);var o;e.below&&(r=t.havingStyle(n.sub()),o=nf(Mf(e.below,r,t),t),o.classes.push(a+`-arrow-pad`));var s=sp(e,t),c=-t.fontMetrics().axisHeight+.5*s.height,l=-t.fontMetrics().axisHeight-.5*s.height-.111;(i.depth>.25||e.label===`\\xleftequilibrium`)&&(l-=i.depth);var u;if(o){var d=-t.fontMetrics().axisHeight+o.height+.5*s.height+.111;u=af({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c,wrapperClasses:[`svg-align`]},{type:`elem`,elem:o,shift:d}]})}else u=af({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c,wrapperClasses:[`svg-align`]}]});return K([`mrel`,`x-arrow`],[u],t)},mathmlBuilder(e,t){var n=ip(e.label);n.setAttribute(`minsize`,e.label.charAt(0)===`x`?`1.75em`:`3.0em`);var r;if(e.body){var i=vp(qf(e.body,t));r=e.below?new J(`munderover`,[n,vp(qf(e.below,t)),i]):new J(`mover`,[n,i])}else e.below?r=new J(`munder`,[n,vp(qf(e.below,t))]):(r=vp(),r=new J(`mover`,[n,r]));return r}});function yp(e,t){var n=Ef(e.body,t,!0);return K([e.mclass],n,t)}function bp(e,t){var n,r=Gf(e.body,t);return e.mclass===`minner`?n=new J(`mpadded`,r):e.mclass===`mord`?e.isCharacterBox?(n=r[0],n.type=`mi`):n=new J(`mi`,r):(e.isCharacterBox?(n=r[0],n.type=`mo`):n=new J(`mo`,r),e.mclass===`mbin`?(n.attributes.lspace=`0.22em`,n.attributes.rspace=`0.22em`):e.mclass===`mpunct`?(n.attributes.lspace=`0em`,n.attributes.rspace=`0.17em`):e.mclass===`mopen`||e.mclass===`mclose`?(n.attributes.lspace=`0em`,n.attributes.rspace=`0em`):e.mclass===`minner`&&(n.attributes.lspace=`0.0556em`,n.attributes.width=`+0.1111em`)),n}q({type:`mclass`,names:[`\\mathord`,`\\mathbin`,`\\mathrel`,`\\mathopen`,`\\mathclose`,`\\mathpunct`,`\\mathinner`],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:`mclass`,mode:n.mode,mclass:`m`+r.slice(5),body:xf(i),isCharacterBox:Hl(i)}},htmlBuilder:yp,mathmlBuilder:bp});var xp=e=>{var t=e.type===`ordgroup`&&e.body.length?e.body[0]:e;return t.type===`atom`&&(t.family===`bin`||t.family===`rel`)?`m`+t.family:`mord`};q({type:`mclass`,names:[`\\@binrel`],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:`mclass`,mode:n.mode,mclass:xp(t[0]),body:xf(t[1]),isCharacterBox:Hl(t[1])}}}),q({type:`mclass`,names:[`\\stackrel`,`\\overset`,`\\underset`],props:{numArgs:2},handler(e,t){var{parser:n,funcName:r}=e,i=t[1],a=t[0],o=r===`\\stackrel`?`mrel`:xp(i),s={type:`op`,mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!==`\\stackrel`,body:xf(i)},c={type:`supsub`,mode:a.mode,base:s,sup:r===`\\underset`?null:a,sub:r===`\\underset`?a:null};return{type:`mclass`,mode:n.mode,mclass:o,body:[c],isCharacterBox:Hl(c)}},htmlBuilder:yp,mathmlBuilder:bp}),q({type:`pmb`,names:[`\\pmb`],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:`pmb`,mode:n.mode,mclass:xp(t[0]),body:xf(t[0])}},htmlBuilder(e,t){var n=Ef(e.body,t,!0),r=K([e.mclass],n,t);return r.style.textShadow=`0.02em 0.01em 0.04px`,r},mathmlBuilder(e,t){var n=new J(`mstyle`,Gf(e.body,t));return n.setAttribute(`style`,`text-shadow: 0.02em 0.01em 0.04px`),n}});var Sp={">":`\\\\cdrightarrow`,"<":`\\\\cdleftarrow`,"=":`\\\\cdlongequal`,A:`\\uparrow`,V:`\\downarrow`,"|":`\\Vert`,".":`no arrow`},Cp=()=>({type:`styling`,body:[],mode:`math`,style:`display`,resetFont:!0}),wp=e=>e.type===`textord`&&e.text===`@`,Tp=(e,t)=>(e.type===`mathord`||e.type===`atom`)&&e.text===t;function Ep(e,t,n){var r=Sp[e];switch(r){case`\\\\cdrightarrow`:case`\\\\cdleftarrow`:return n.callFunction(r,[t[0]],[t[1]]);case`\\uparrow`:case`\\downarrow`:var i=n.callFunction(`\\\\cdleft`,[t[0]],[]),a={type:`atom`,text:r,mode:`math`,family:`rel`},o={type:`ordgroup`,mode:`math`,body:[i,n.callFunction(`\\Big`,[a],[]),n.callFunction(`\\\\cdright`,[t[1]],[])]};return n.callFunction(`\\\\cdparent`,[o],[]);case`\\\\cdlongequal`:return n.callFunction(`\\\\cdlongequal`,[],[]);case`\\Vert`:return n.callFunction(`\\Big`,[{type:`textord`,text:`\\Vert`,mode:`math`}],[]);default:return{type:`textord`,text:` `,mode:`math`}}}function Dp(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set(`\\cr`,`\\\\\\relax`),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,`\\\\`)),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n===`&`||n===`\\\\`)e.consume();else if(n===`\\end`){t[t.length-1].length===0&&t.pop();break}else throw new N(`Expected \\\\ or \\cr or \\end`,e.nextToken)}for(var r=[],i=[r],a=0;a<t.length;a++){for(var o=t[a],s=Cp(),c=0;c<o.length;c++)if(!wp(o[c]))s.body.push(o[c]);else{r.push(s),c+=1;var l=fp(o[c]).text,u=[,,];if(u[0]={type:`ordgroup`,mode:`math`,body:[]},u[1]={type:`ordgroup`,mode:`math`,body:[]},!`=|.`.includes(l))if(`<>AV`.includes(l))for(var d=0;d<2;d++){for(var f=!0,p=c+1;p<o.length;p++){if(Tp(o[p],l)){f=!1,c=p;break}if(wp(o[p]))throw new N(`Missing a `+l+` character to complete a CD arrow.`,o[p]);u[d].body.push(o[p])}if(f)throw new N(`Missing a `+l+` character to complete a CD arrow.`,o[c])}else throw new N(`Expected one of "<>AV=|." after @`,o[c]);var m={type:`styling`,body:[Ep(l,u,e)],mode:`math`,style:`display`,resetFont:!0};r.push(m),s=Cp()}a%2==0?r.push(s):r.shift(),r=[],i.push(r)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:`array`,mode:`math`,body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:Array(i[0].length).fill({type:`align`,align:`c`,pregap:.25,postgap:.25}),colSeparationType:`CD`,hLinesBeforeRow:Array(i.length+1).fill([])}}q({type:`cdlabel`,names:[`\\\\cdleft`,`\\\\cdright`],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:`cdlabel`,mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=nf(Mf(e.label,n,t),t);return r.classes.push(`cd-label-`+e.side),r.style.bottom=F(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new J(`mrow`,[qf(e.label,t)]);return n=new J(`mpadded`,[n]),n.setAttribute(`width`,`0`),e.side===`left`&&n.setAttribute(`lspace`,`-1width`),n.setAttribute(`voffset`,`0.7em`),n=new J(`mstyle`,[n]),n.setAttribute(`displaystyle`,`false`),n.setAttribute(`scriptlevel`,`1`),n}}),q({type:`cdlabelparent`,names:[`\\\\cdparent`],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:`cdlabelparent`,mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=nf(Mf(e.fragment,t),t);return n.classes.push(`cd-vert-arrow`),n},mathmlBuilder(e,t){return new J(`mrow`,[qf(e.fragment,t)])}}),q({type:`textord`,names:[`\\@char`],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=Y(t[0],`ordgroup`).body,i=``,a=0;a<r.length;a++){var o=Y(r[a],`textord`);i+=o.text}var s=parseInt(i),c;if(isNaN(s))throw new N(`\\@char has non-numeric argument `+i);if(s<0||s>=1114111)throw new N(`\\@char with invalid code point `+i);return s<=65535?c=String.fromCharCode(s):(s-=65536,c=String.fromCharCode((s>>10)+55296,(s&1023)+56320)),{type:`textord`,mode:n.mode,text:c}}});var Op=(e,t)=>tf(Ef(e.body,t.withColor(e.color),!1)),kp=(e,t)=>{var n=new J(`mstyle`,Gf(e.body,t.withColor(e.color)));return n.setAttribute(`mathcolor`,e.color),n};q({type:`color`,names:[`\\textcolor`],props:{numArgs:2,allowedInText:!0,argTypes:[`color`,`original`]},handler(e,t){var{parser:n}=e,r=Y(t[0],`color-token`).color,i=t[1];return{type:`color`,mode:n.mode,color:r,body:xf(i)}},htmlBuilder:Op,mathmlBuilder:kp}),q({type:`color`,names:[`\\color`],props:{numArgs:1,allowedInText:!0,argTypes:[`color`]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,i=Y(t[0],`color-token`).color;n.gullet.macros.set(`\\current@color`,i);var a=n.parseExpression(!0,r);return{type:`color`,mode:n.mode,color:i,body:a}},htmlBuilder:Op,mathmlBuilder:kp}),q({type:`cr`,names:[`\\\\`],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:r}=e,i=r.gullet.future().text===`[`?r.parseSizeGroup(!0):null,a=!r.settings.displayMode||!r.settings.useStrictBehavior(`newLineInDisplayMode`,`In LaTeX, \\\\ or \\newline does nothing in display mode`);return{type:`cr`,mode:r.mode,newLine:a,size:i&&Y(i,`size`).value}},htmlBuilder(e,t){var n=K([`mspace`],[],t);return e.newLine&&(n.classes.push(`newline`),e.size&&(n.style.marginTop=F(Nu(e.size,t)))),n},mathmlBuilder(e,t){var n=new J(`mspace`);return e.newLine&&(n.setAttribute(`linebreak`,`newline`),e.size&&n.setAttribute(`height`,F(Nu(e.size,t)))),n}});var Ap={"\\global":`\\global`,"\\long":`\\\\globallong`,"\\\\globallong":`\\\\globallong`,"\\def":`\\gdef`,"\\gdef":`\\gdef`,"\\edef":`\\xdef`,"\\xdef":`\\xdef`,"\\let":`\\\\globallet`,"\\futurelet":`\\\\globalfuture`},jp=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new N(`Expected a control sequence`,e);return t},Mp=e=>{var t=e.gullet.popToken();return t.text===`=`&&(t=e.gullet.popToken(),t.text===` `&&(t=e.gullet.popToken())),t},Np=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);i??=(n.noexpand=!0,{tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};q({type:`internal`,names:[`\\global`,`\\long`,`\\\\globallong`],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(Ap[r.text])return(n===`\\global`||n===`\\\\globallong`)&&(r.text=Ap[r.text]),Y(t.parseFunction(),`internal`);throw new N(`Invalid token after macro prefix`,r)}}),q({type:`internal`,names:[`\\def`,`\\gdef`,`\\edef`,`\\xdef`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new N(`Expected a control sequence`,r);for(var a=0,o,s=[[]];t.gullet.future().text!==`{`;)if(r=t.gullet.popToken(),r.text===`#`){if(t.gullet.future().text===`{`){o=t.gullet.future(),s[a].push(`{`);break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new N(`Invalid argument number "`+r.text+`"`);if(parseInt(r.text)!==a+1)throw new N(`Argument number "`+r.text+`" out of order`);a++,s.push([])}else if(r.text===`EOF`)throw new N(`Expected a macro definition`);else s[a].push(r.text);var{tokens:c}=t.gullet.consumeArg();return o&&c.unshift(o),(n===`\\edef`||n===`\\xdef`)&&(c=t.gullet.expandTokens(c),c.reverse()),t.gullet.macros.set(i,{tokens:c,numArgs:a,delimiters:s},n===Ap[n]),{type:`internal`,mode:t.mode}}}),q({type:`internal`,names:[`\\let`,`\\\\globallet`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=jp(t.gullet.popToken());return t.gullet.consumeSpaces(),Np(t,r,Mp(t),n===`\\\\globallet`),{type:`internal`,mode:t.mode}}}),q({type:`internal`,names:[`\\futurelet`,`\\\\globalfuture`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=jp(t.gullet.popToken()),i=t.gullet.popToken(),a=t.gullet.popToken();return Np(t,r,a,n===`\\\\globalfuture`),t.gullet.pushToken(a),t.gullet.pushToken(i),{type:`internal`,mode:t.mode}}});var Pp=function(e,t,n){var r=td(id.math[e]&&id.math[e].replace||e,t,n);if(!r)throw Error(`Unsupported symbol `+e+` and font size `+t+`.`);return r},Fp=function(e,t,n,r){var i=n.havingBaseStyle(t),a=K(r.concat(i.sizingClasses(n)),[e],n),o=i.sizeMultiplier/n.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},Ip=function(e,t,n){var r=t.havingBaseStyle(n),i=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push(`delimcenter`),e.style.top=F(i),e.height-=i,e.depth+=i},Lp=function(e,t,n,r,i,a){var o=Fp(Gd(e,`Main-Regular`,i,r),t,r,a);return n&&Ip(o,r,t),o},Rp=function(e,t,n,r){return Gd(e,`Size`+t+`-Regular`,n,r)},zp=function(e,t,n,r,i,a){var o=Rp(e,t,i,r),s=Fp(K([`delimsizing`,`size`+t],[o],r),P.TEXT,r,a);return n&&Ip(s,r,P.TEXT),s},Bp=function(e,t,n){return{type:`elem`,elem:K([`delimsizinginner`,t===`Size1-Regular`?`delim-size1`:`delim-size4`],[K([],[Gd(e,t,n)])])}},Vp=function(e,t,n){var r=Zu[`Size4-Regular`][e.charCodeAt(0)]?Zu[`Size4-Regular`][e.charCodeAt(0)][4]:Zu[`Size1-Regular`][e.charCodeAt(0)][4],i=Qd([],[new Gu([new Ku(`inner`,Tu(e,Math.round(1e3*t)))],{width:F(r),height:F(t),style:`width:`+F(r),viewBox:`0 0 `+1e3*r+` `+Math.round(1e3*t),preserveAspectRatio:`xMinYMin`})],n);return i.height=t,i.style.height=F(t),i.style.width=F(r),{type:`elem`,elem:i}},Hp=.008,Up={type:`kern`,size:-1*Hp},Wp=new Set([`|`,`\\lvert`,`\\rvert`,`\\vert`]),Gp=new Set([`\\|`,`\\lVert`,`\\rVert`,`\\Vert`]),Kp=function(e,t,n,r,i,a){var o,s,c,l,u=``,d=0;o=c=l=e,s=null;var f=`Size1-Regular`;e===`\\uparrow`?c=l=`⏐`:e===`\\Uparrow`?c=l=`‖`:e===`\\downarrow`?o=c=`⏐`:e===`\\Downarrow`?o=c=`‖`:e===`\\updownarrow`?(o=`\\uparrow`,c=`⏐`,l=`\\downarrow`):e===`\\Updownarrow`?(o=`\\Uparrow`,c=`‖`,l=`\\Downarrow`):Wp.has(e)?(c=`∣`,u=`vert`,d=333):Gp.has(e)?(c=`∥`,u=`doublevert`,d=556):e===`[`||e===`\\lbrack`?(o=`⎡`,c=`⎢`,l=`⎣`,f=`Size4-Regular`,u=`lbrack`,d=667):e===`]`||e===`\\rbrack`?(o=`⎤`,c=`⎥`,l=`⎦`,f=`Size4-Regular`,u=`rbrack`,d=667):e===`\\lfloor`||e===`⌊`?(c=o=`⎢`,l=`⎣`,f=`Size4-Regular`,u=`lfloor`,d=667):e===`\\lceil`||e===`⌈`?(o=`⎡`,c=l=`⎢`,f=`Size4-Regular`,u=`lceil`,d=667):e===`\\rfloor`||e===`⌋`?(c=o=`⎥`,l=`⎦`,f=`Size4-Regular`,u=`rfloor`,d=667):e===`\\rceil`||e===`⌉`?(o=`⎤`,c=l=`⎥`,f=`Size4-Regular`,u=`rceil`,d=667):e===`(`||e===`\\lparen`?(o=`⎛`,c=`⎜`,l=`⎝`,f=`Size4-Regular`,u=`lparen`,d=875):e===`)`||e===`\\rparen`?(o=`⎞`,c=`⎟`,l=`⎠`,f=`Size4-Regular`,u=`rparen`,d=875):e===`\\{`||e===`\\lbrace`?(o=`⎧`,s=`⎨`,l=`⎩`,c=`⎪`,f=`Size4-Regular`):e===`\\}`||e===`\\rbrace`?(o=`⎫`,s=`⎬`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):e===`\\lgroup`||e===`⟮`?(o=`⎧`,l=`⎩`,c=`⎪`,f=`Size4-Regular`):e===`\\rgroup`||e===`⟯`?(o=`⎫`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):e===`\\lmoustache`||e===`⎰`?(o=`⎧`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):(e===`\\rmoustache`||e===`⎱`)&&(o=`⎫`,l=`⎩`,c=`⎪`,f=`Size4-Regular`);var p=Pp(o,f,i),m=p.height+p.depth,h=Pp(c,f,i),g=h.height+h.depth,_=Pp(l,f,i),v=_.height+_.depth,y=0,b=1;if(s!==null){var x=Pp(s,f,i);y=x.height+x.depth,b=2}var S=m+v+y,C=S+Math.max(0,Math.ceil((t-S)/(b*g)))*b*g,w=r.fontMetrics().axisHeight;n&&(w*=r.sizeMultiplier);var T=C/2-w,E=[];if(u.length>0){var ee=C-m-v,te=Math.round(C*1e3),D=Du(u,Math.round(ee*1e3)),ne=new Ku(u,D),re=F(d/1e3),ie=F(te/1e3),ae=Qd([],[new Gu([ne],{width:re,height:ie,viewBox:`0 0 `+d+` `+te})],r);ae.height=te/1e3,ae.style.width=re,ae.style.height=ie,E.push({type:`elem`,elem:ae})}else{if(E.push(Bp(l,f,i)),E.push(Up),s===null){var oe=C-m-v+2*Hp;E.push(Vp(c,oe,r))}else{var se=(C-m-v-y)/2+2*Hp;E.push(Vp(c,se,r)),E.push(Up),E.push(Bp(s,f,i)),E.push(Up),E.push(Vp(c,se,r))}E.push(Up),E.push(Bp(o,f,i))}var O=r.havingBaseStyle(P.TEXT);return Fp(K([`delimsizing`,`mult`],[af({positionType:`bottom`,positionData:T,children:E})],O),P.TEXT,r,a)},qp=80,Jp=.08,Yp=function(e,t,n,r,i){return Qd([`hide-tail`],[new Gu([new Ku(e,wu(e,r,n))],{width:`400em`,height:F(t),viewBox:`0 0 400000 `+n,preserveAspectRatio:`xMinYMin slice`})],i)},Xp=function(e,t){var n=t.havingBaseSizing(),r=om(`\\surd`,e*n.sizeMultiplier,im,n),i=n.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,s,c,l,u;return r.type===`small`?(l=1e3+1e3*a+qp,e<1?i=1:e<1.4&&(i=.7),s=(1+a+Jp)/i,c=(1+a)/i,o=Yp(`sqrtMain`,s,l,a,t),o.style.minWidth=`0.853em`,u=.833/i):r.type===`large`?(l=(1e3+qp)*em[r.size],c=(em[r.size]+a)/i,s=(em[r.size]+a+Jp)/i,o=Yp(`sqrtSize`+r.size,s,l,a,t),o.style.minWidth=`1.02em`,u=1/i):(s=e+a+Jp,c=e+a,l=Math.floor(1e3*e+a)+qp,o=Yp(`sqrtTall`,s,l,a,t),o.style.minWidth=`0.742em`,u=1.056),o.height=c,o.style.height=F(s),{span:o,advanceWidth:u,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},Zp=new Set([`(`,`\\lparen`,`)`,`\\rparen`,`[`,`\\lbrack`,`]`,`\\rbrack`,`\\{`,`\\lbrace`,`\\}`,`\\rbrace`,`\\lfloor`,`\\rfloor`,`⌊`,`⌋`,`\\lceil`,`\\rceil`,`⌈`,`⌉`,`\\surd`]),Qp=new Set([`\\uparrow`,`\\downarrow`,`\\updownarrow`,`\\Uparrow`,`\\Downarrow`,`\\Updownarrow`,`|`,`\\|`,`\\vert`,`\\Vert`,`\\lvert`,`\\rvert`,`\\lVert`,`\\rVert`,`\\lgroup`,`\\rgroup`,`⟮`,`⟯`,`\\lmoustache`,`\\rmoustache`,`⎰`,`⎱`]),$p=new Set([`<`,`>`,`\\langle`,`\\rangle`,`/`,`\\backslash`,`\\lt`,`\\gt`]),em=[0,1.2,1.8,2.4,3],tm=function(e,t,n,r,i){if(e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`),Zp.has(e)||$p.has(e))return zp(e,t,!1,n,r,i);if(Qp.has(e))return Kp(e,em[t],!1,n,r,i);throw new N(`Illegal delimiter: '`+e+`'`)},nm=[{type:`small`,style:P.SCRIPTSCRIPT},{type:`small`,style:P.SCRIPT},{type:`small`,style:P.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4}],rm=[{type:`small`,style:P.SCRIPTSCRIPT},{type:`small`,style:P.SCRIPT},{type:`small`,style:P.TEXT},{type:`stack`}],im=[{type:`small`,style:P.SCRIPTSCRIPT},{type:`small`,style:P.SCRIPT},{type:`small`,style:P.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4},{type:`stack`}],am=function(e){if(e.type===`small`)return`Main-Regular`;if(e.type===`large`)return`Size`+e.size+`-Regular`;if(e.type===`stack`)return`Size4-Regular`;var t=e.type;throw Error(`Add support for delim type '`+t+`' here.`)},om=function(e,t,n,r){for(var i=Math.min(2,3-r.style.size);i<n.length;i++){var a=n[i];if(a.type===`stack`)break;var o=Pp(e,am(a),`math`),s=o.height+o.depth;if(a.type===`small`){var c=r.havingBaseStyle(a.style);s*=c.sizeMultiplier}if(s>t)return a}return n[n.length-1]},sm=function(e,t,n,r,i,a){e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`);var o=$p.has(e)?nm:Zp.has(e)?im:rm,s=om(e,t,o,r);return s.type===`small`?Lp(e,s.style,n,r,i,a):s.type===`large`?zp(e,s.size,n,r,i,a):Kp(e,t,n,r,i,a)},cm=function(e,t,n,r,i,a){var o=r.fontMetrics().axisHeight*r.sizeMultiplier,s=901,c=5/r.fontMetrics().ptPerEm,l=Math.max(t-o,n+o);return sm(e,Math.max(l/500*s,2*l-c),!0,r,i,a)},lm={"\\bigl":{mclass:`mopen`,size:1},"\\Bigl":{mclass:`mopen`,size:2},"\\biggl":{mclass:`mopen`,size:3},"\\Biggl":{mclass:`mopen`,size:4},"\\bigr":{mclass:`mclose`,size:1},"\\Bigr":{mclass:`mclose`,size:2},"\\biggr":{mclass:`mclose`,size:3},"\\Biggr":{mclass:`mclose`,size:4},"\\bigm":{mclass:`mrel`,size:1},"\\Bigm":{mclass:`mrel`,size:2},"\\biggm":{mclass:`mrel`,size:3},"\\Biggm":{mclass:`mrel`,size:4},"\\big":{mclass:`mord`,size:1},"\\Big":{mclass:`mord`,size:2},"\\bigg":{mclass:`mord`,size:3},"\\Bigg":{mclass:`mord`,size:4}},um=new Set(`(,\\lparen,),\\rparen,[,\\lbrack,],\\rbrack,\\{,\\lbrace,\\},\\rbrace,\\lfloor,\\rfloor,⌊,⌋,\\lceil,\\rceil,⌈,⌉,<,>,\\langle,⟨,\\rangle,⟩,\\lt,\\gt,\\lvert,\\rvert,\\lVert,\\rVert,\\lgroup,\\rgroup,⟮,⟯,\\lmoustache,\\rmoustache,⎰,⎱,/,\\backslash,|,\\vert,\\|,\\Vert,\\uparrow,\\Uparrow,\\downarrow,\\Downarrow,\\updownarrow,\\Updownarrow,.`.split(`,`));function dm(e){return`isMiddle`in e}function fm(e,t){var n=pp(e);if(n&&um.has(n.text))return n;throw n?new N(`Invalid delimiter '`+n.text+`' after '`+t.funcName+`'`,e):new N(`Invalid delimiter type '`+e.type+`'`,e)}q({type:`delimsizing`,names:[`\\bigl`,`\\Bigl`,`\\biggl`,`\\Biggl`,`\\bigr`,`\\Bigr`,`\\biggr`,`\\Biggr`,`\\bigm`,`\\Bigm`,`\\biggm`,`\\Biggm`,`\\big`,`\\Big`,`\\bigg`,`\\Bigg`],props:{numArgs:1,argTypes:[`primitive`]},handler:(e,t)=>{var n=fm(t[0],e);return{type:`delimsizing`,mode:e.parser.mode,size:lm[e.funcName].size,mclass:lm[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim===`.`?K([e.mclass]):tm(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!==`.`&&t.push(Bf(e.delim,e.mode));var n=new J(`mo`,t);e.mclass===`mopen`||e.mclass===`mclose`?n.setAttribute(`fence`,`true`):n.setAttribute(`fence`,`false`),n.setAttribute(`stretchy`,`true`);var r=F(em[e.size]);return n.setAttribute(`minsize`,r),n.setAttribute(`maxsize`,r),n}});function pm(e){if(!e.body)throw Error(`Bug: The leftright ParseNode wasn't fully parsed.`)}q({type:`leftright-right`,names:[`\\right`],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get(`\\current@color`);if(n&&typeof n!=`string`)throw new N(`\\current@color set to non-string in \\right`);return{type:`leftright-right`,mode:e.parser.mode,delim:fm(t[0],e).text,color:n}}}),q({type:`leftright`,names:[`\\left`],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=fm(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect(`\\right`,!1);var a=Y(r.parseFunction(),`leftright-right`);return{type:`leftright`,mode:r.mode,body:i,left:n.text,right:a.delim,rightColor:a.color}},htmlBuilder:(e,t)=>{pm(e);for(var n=Ef(e.body,t,!0,[`mopen`,`mclose`]),r=0,i=0,a=!1,o=0;o<n.length;o++){var s=n[o];dm(s)?a=!0:(r=Math.max(n[o].height,r),i=Math.max(n[o].depth,i))}r*=t.sizeMultiplier,i*=t.sizeMultiplier;var c=e.left===`.`?jf(t,[`mopen`]):cm(e.left,r,i,t,e.mode,[`mopen`]);if(n.unshift(c),a)for(var l=1;l<n.length;l++){var u=n[l];if(dm(u)){var d=u.isMiddle;n[l]=cm(d.delim,r,i,d.options,e.mode,[])}}var f;if(e.right===`.`)f=jf(t,[`mclose`]);else{var p=e.rightColor?t.withColor(e.rightColor):t;f=cm(e.right,r,i,p,e.mode,[`mclose`])}return n.push(f),K([`minner`],n,t)},mathmlBuilder:(e,t)=>{pm(e);var n=Gf(e.body,t);if(e.left!==`.`){var r=new J(`mo`,[Bf(e.left,e.mode)]);r.setAttribute(`fence`,`true`),n.unshift(r)}if(e.right!==`.`){var i=new J(`mo`,[Bf(e.right,e.mode)]);i.setAttribute(`fence`,`true`),e.rightColor&&i.setAttribute(`mathcolor`,e.rightColor),n.push(i)}return Vf(n)}}),q({type:`middle`,names:[`\\middle`],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=fm(t[0],e);if(!e.parser.leftrightDepth)throw new N(`\\middle without preceding \\left`,n);return{type:`middle`,mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim===`.`?n=jf(t,[]):(n=tm(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t}),n},mathmlBuilder:(e,t)=>{var n=new J(`mo`,[e.delim===`\\vert`||e.delim===`|`?Bf(`|`,`text`):Bf(e.delim,e.mode)]);return n.setAttribute(`fence`,`true`),n.setAttribute(`lspace`,`0.05em`),n.setAttribute(`rspace`,`0.05em`),n}});var mm=(e,t)=>{var n=nf(Mf(e.body,t),t),r=e.label.slice(1),i=t.sizeMultiplier,a,o,s=Hl(e.body);if(r===`sout`)a=K([`stretchy`,`sout`]),a.height=t.fontMetrics().defaultRuleThickness/i,o=-.5*t.fontMetrics().xHeight;else if(r===`phase`){var c=Nu({number:.6,unit:`pt`},t),l=Nu({number:.35,unit:`ex`},t),u=t.havingBaseSizing();i/=u.sizeMultiplier;var d=n.height+n.depth+c+l;n.style.paddingLeft=F(d/2+c);var f=Math.floor(1e3*d*i);a=Qd([`hide-tail`],[new Gu([new Ku(`phase`,Su(f))],{width:`400em`,height:F(f/1e3),viewBox:`0 0 400000 `+f,preserveAspectRatio:`xMinYMin slice`})],t),a.style.height=F(d),o=n.depth+c+l}else{/cancel/.test(r)?s||n.classes.push(`cancel-pad`):r===`angl`?n.classes.push(`anglpad`):n.classes.push(`boxpad`);var p,m,h=0;/box/.test(r)?(h=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),p=t.fontMetrics().fboxsep+(r===`colorbox`?0:h),m=p):r===`angl`?(h=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),p=4*h,m=Math.max(0,.25-n.depth)):(p=s?.2:0,m=p),a=cp(n,r,p,m,t),/fbox|boxed|fcolorbox/.test(r)?(a.style.borderStyle=`solid`,a.style.borderWidth=F(h)):r===`angl`&&h!==.049&&(a.style.borderTopWidth=F(h),a.style.borderRightWidth=F(h)),o=n.depth+m,e.backgroundColor&&(a.style.backgroundColor=e.backgroundColor,e.borderColor&&(a.style.borderColor=e.borderColor))}var g;if(e.backgroundColor)g=af({positionType:`individualShift`,children:[{type:`elem`,elem:a,shift:o},{type:`elem`,elem:n,shift:0}]});else{var _=/cancel|phase/.test(r)?[`svg-align`]:[];g=af({positionType:`individualShift`,children:[{type:`elem`,elem:n,shift:0},{type:`elem`,elem:a,shift:o,wrapperClasses:_}]})}return/cancel/.test(r)&&(g.height=n.height,g.depth=n.depth),/cancel/.test(r)&&!s?K([`mord`,`cancel-lap`],[g],t):K([`mord`],[g],t)},hm=(e,t)=>{var n,r=new J(e.label.includes(`colorbox`)?`mpadded`:`menclose`,[qf(e.body,t)]);switch(e.label){case`\\cancel`:r.setAttribute(`notation`,`updiagonalstrike`);break;case`\\bcancel`:r.setAttribute(`notation`,`downdiagonalstrike`);break;case`\\phase`:r.setAttribute(`notation`,`phasorangle`);break;case`\\sout`:r.setAttribute(`notation`,`horizontalstrike`);break;case`\\fbox`:r.setAttribute(`notation`,`box`);break;case`\\angl`:r.setAttribute(`notation`,`actuarial`);break;case`\\fcolorbox`:case`\\colorbox`:if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute(`width`,`+`+2*n+`pt`),r.setAttribute(`height`,`+`+2*n+`pt`),r.setAttribute(`lspace`,n+`pt`),r.setAttribute(`voffset`,n+`pt`),e.label===`\\fcolorbox`){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute(`style`,`border: `+F(i)+` solid `+e.borderColor)}break;case`\\xcancel`:r.setAttribute(`notation`,`updiagonalstrike downdiagonalstrike`);break}return e.backgroundColor&&r.setAttribute(`mathbackground`,e.backgroundColor),r};q({type:`enclose`,names:[`\\colorbox`],props:{numArgs:2,allowedInText:!0,argTypes:[`color`,`hbox`]},handler(e,t,n){var{parser:r,funcName:i}=e,a=Y(t[0],`color-token`).color,o=t[1];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:a,body:o}},htmlBuilder:mm,mathmlBuilder:hm}),q({type:`enclose`,names:[`\\fcolorbox`],props:{numArgs:3,allowedInText:!0,argTypes:[`color`,`color`,`hbox`]},handler(e,t,n){var{parser:r,funcName:i}=e,a=Y(t[0],`color-token`).color,o=Y(t[1],`color-token`).color,s=t[2];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:o,borderColor:a,body:s}},htmlBuilder:mm,mathmlBuilder:hm}),q({type:`enclose`,names:[`\\fbox`],props:{numArgs:1,argTypes:[`hbox`],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:`enclose`,mode:n.mode,label:`\\fbox`,body:t[0]}}}),q({type:`enclose`,names:[`\\cancel`,`\\bcancel`,`\\xcancel`,`\\phase`],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}},htmlBuilder:mm,mathmlBuilder:hm}),q({type:`enclose`,names:[`\\sout`],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e;n.mode===`math`&&n.settings.reportNonstrict(`mathVsSout`,`LaTeX's \\sout works only in text mode`);var i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}},htmlBuilder:mm,mathmlBuilder:hm}),q({type:`enclose`,names:[`\\angl`],props:{numArgs:1,argTypes:[`hbox`],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:`enclose`,mode:n.mode,label:`\\angl`,body:t[0]}}});var gm={};function _m(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:o}=e,s={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},c=0;c<n.length;++c)gm[n[c]]=s;a&&(_f[t]=a),o&&(vf[t]=o)}var vm={};function X(e,t){vm[e]=t}var ym=class e{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(t,n){return n?!t||!t.loc||!n.loc||t.loc.lexer!==n.loc.lexer?null:new e(t.loc.lexer,t.loc.start,n.loc.end):t&&t.loc}},bm=class e{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(t,n){return new e(n,ym.range(this,t))}};function xm(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for(n===`\\relax`&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);n===`\\hline`||n===`\\hdashline`;)e.consume(),t.push(n===`\\hdashline`),e.consumeSpaces(),n=e.fetch().text;return t}var Sm=e=>{if(!e.parser.settings.displayMode)throw new N(`{`+e.envName+`} can be used only in display mode.`)},Cm=new Set([`gather`,`gather*`]);function wm(e){if(!e.includes(`ed`))return!e.includes(`*`)}function Tm(e,t,n){var{hskipBeforeAndAfter:r,addJot:i,cols:a,arraystretch:o,colSeparationType:s,autoTag:c,singleRow:l,emptySingleRow:u,maxNumCols:d,leqno:f}=t;if(e.gullet.beginGroup(),l||e.gullet.macros.set(`\\cr`,`\\\\\\relax`),!o){var p=e.gullet.expandMacroAsText(`\\arraystretch`);if(p==null)o=1;else if(o=parseFloat(p),!o||o<0)throw new N(`Invalid \\arraystretch: `+p)}e.gullet.beginGroup();var m=[],h=[m],g=[],_=[],v=c==null?void 0:[];function y(){c&&e.gullet.macros.set(`\\@eqnsw`,`1`,!0)}function b(){v&&(e.gullet.macros.get(`\\df@tag`)?(v.push(e.subparse([new bm(`\\df@tag`)])),e.gullet.macros.set(`\\df@tag`,void 0,!0)):v.push(!!c&&e.gullet.macros.get(`\\@eqnsw`)===`1`))}for(y(),_.push(xm(e));;){var x=e.parseExpression(!1,l?`\\end`:`\\\\`);e.gullet.endGroup(),e.gullet.beginGroup();var S={type:`ordgroup`,mode:e.mode,body:x};n&&(S={type:`styling`,mode:e.mode,style:n,resetFont:!0,body:[S]}),m.push(S);var C=e.fetch().text;if(C===`&`){if(d&&m.length===d){if(l||s)throw new N(`Too many tab characters: &`,e.nextToken);e.settings.reportNonstrict(`textEnv`,`Too few columns specified in the {array} column argument.`)}e.consume()}else if(C===`\\end`){b(),m.length===1&&S.type===`styling`&&S.body.length===1&&S.body[0].type===`ordgroup`&&S.body[0].body.length===0&&(h.length>1||!u)&&h.pop(),_.length<h.length+1&&_.push([]);break}else if(C===`\\\\`){e.consume();var w=void 0;e.gullet.future().text!==` `&&(w=e.parseSizeGroup(!0)),g.push(w?w.value:null),b(),_.push(xm(e)),m=[],h.push(m),y()}else throw new N(`Expected & or \\\\ or \\cr or \\end`,e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:`array`,mode:e.mode,addJot:i,arraystretch:o,body:h,cols:a,rowGaps:g,hskipBeforeAndAfter:r,hLinesBeforeRow:_,colSeparationType:s,tags:v,leqno:f}}function Em(e){return e.slice(0,1)===`d`?`display`:`text`}var Dm=function(e,t){var n,r,i=e.body.length,a=e.hLinesBeforeRow,o=0,s=Array(i),c=[],l=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),u=1/t.fontMetrics().ptPerEm,d=5*u;e.colSeparationType&&e.colSeparationType===`small`&&(d=.2778*(t.havingStyle(P.SCRIPT).sizeMultiplier/t.sizeMultiplier));var f=e.colSeparationType===`CD`?Nu({number:3,unit:`ex`},t):12*u,p=3*u,m=e.arraystretch*f,h=.7*m,g=.3*m,_=0;function v(e){for(var t=0;t<e.length;++t)t>0&&(_+=.25),c.push({pos:_,isDashed:e[t]})}for(v(a[0]),n=0;n<e.body.length;++n){var y=e.body[n],b=h,x=g;o<y.length&&(o=y.length);var S={cells:Array(y.length),height:0,depth:0,pos:0};for(r=0;r<y.length;++r){var C=Mf(y[r],t);x<C.depth&&(x=C.depth),b<C.height&&(b=C.height),S.cells[r]=C}var w=e.rowGaps[n],T=0;w&&(T=Nu(w,t),T>0&&(T+=g,x<T&&(x=T),T=0)),e.addJot&&n<e.body.length-1&&(x+=p),S.height=b,S.depth=x,_+=b,S.pos=_,_+=x+T,s[n]=S,v(a[n+1])}var E=_/2+t.fontMetrics().axisHeight,ee=e.cols||[],te=[],D,ne,re=[];if(e.tags&&e.tags.some(e=>e))for(n=0;n<i;++n){var ie=s[n],ae=ie.pos-E,oe=e.tags[n],se=void 0;se=oe===!0?K([`eqn-num`],[],t):oe===!1?K([],[],t):K([],Ef(oe,t,!0),t),se.depth=ie.depth,se.height=ie.height,re.push({type:`elem`,elem:se,shift:ae})}for(r=0,ne=0;r<o||ne<ee.length;++r,++ne){for(var O=ee[ne],ce=!0;(le=O)?.type===`separator`;){var le;if(ce||(D=K([`arraycolsep`],[]),D.style.width=F(t.fontMetrics().doubleRuleSep),te.push(D)),O.separator===`|`||O.separator===`:`){var ue=O.separator===`|`?`solid`:`dashed`,de=K([`vertical-separator`],[],t);de.style.height=F(_),de.style.borderRightWidth=F(l),de.style.borderRightStyle=ue,de.style.margin=`0 `+F(-l/2);var fe=_-E;fe&&(de.style.verticalAlign=F(-fe)),te.push(de)}else throw new N(`Invalid separator type: `+O.separator);ne++,O=ee[ne],ce=!1}if(!(r>=o)){var pe=void 0;(r>0||e.hskipBeforeAndAfter)&&(pe=O?.pregap??d,pe!==0&&(D=K([`arraycolsep`],[]),D.style.width=F(pe),te.push(D)));var me=[];for(n=0;n<i;++n){var he=s[n],ge=he.cells[r];if(ge){var _e=he.pos-E;ge.depth=he.depth,ge.height=he.height,me.push({type:`elem`,elem:ge,shift:_e})}}var ve=af({positionType:`individualShift`,children:me}),ye=K([`col-align-`+(O?.align||`c`)],[ve]);te.push(ye),(r<o-1||e.hskipBeforeAndAfter)&&(pe=O?.postgap??d,pe!==0&&(D=K([`arraycolsep`],[]),D.style.width=F(pe),te.push(D)))}}var be=K([`mtable`],te);if(c.length>0){for(var k=$d(`hline`,t,l),xe=$d(`hdashline`,t,l),Se=[{type:`elem`,elem:be,shift:0}];c.length>0;){var Ce=c.pop(),we=Ce.pos-E;Ce.isDashed?Se.push({type:`elem`,elem:xe,shift:we}):Se.push({type:`elem`,elem:k,shift:we})}be=af({positionType:`individualShift`,children:Se})}if(re.length===0)return K([`mord`],[be],t);var Te=K([`tag`],[af({positionType:`individualShift`,children:re})],t);return tf([be,Te])},Om={c:`center `,l:`left `,r:`right `},km=function(e,t){for(var n=[],r=new J(`mtd`,[],[`mtr-glue`]),i=new J(`mtd`,[],[`mml-eqn-num`]),a=0;a<e.body.length;a++){for(var o=e.body[a],s=[],c=0;c<o.length;c++)s.push(new J(`mtd`,[qf(o[c],t)]));e.tags&&e.tags[a]&&(s.unshift(r),s.push(r),e.leqno?s.unshift(i):s.push(i)),n.push(new J(`mtr`,s))}var l=new J(`mtable`,n),u=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);l.setAttribute(`rowspacing`,F(u));var d=``,f=``;if(e.cols&&e.cols.length>0){var p=e.cols,m=``,h=!1,g=0,_=p.length;p[0].type===`separator`&&(d+=`top `,g=1),p[p.length-1].type===`separator`&&(d+=`bottom `,--_);for(var v=g;v<_;v++){var y=p[v];y.type===`align`?(f+=Om[y.align],h&&(m+=`none `),h=!0):y.type===`separator`&&(h&&=(m+=y.separator===`|`?`solid `:`dashed `,!1))}l.setAttribute(`columnalign`,f.trim()),/[sd]/.test(m)&&l.setAttribute(`columnlines`,m.trim())}if(e.colSeparationType===`align`){for(var b=e.cols||[],x=``,S=1;S<b.length;S++)x+=S%2?`0em `:`1em `;l.setAttribute(`columnspacing`,x.trim())}else e.colSeparationType===`alignat`||e.colSeparationType===`gather`?l.setAttribute(`columnspacing`,`0em`):e.colSeparationType===`small`?l.setAttribute(`columnspacing`,`0.2778em`):e.colSeparationType===`CD`?l.setAttribute(`columnspacing`,`0.5em`):l.setAttribute(`columnspacing`,`1em`);var C=``,w=e.hLinesBeforeRow;d+=w[0].length>0?`left `:``,d+=w[w.length-1].length>0?`right `:``;for(var T=1;T<w.length-1;T++)C+=w[T].length===0?`none `:w[T][0]?`dashed `:`solid `;return/[sd]/.test(C)&&l.setAttribute(`rowlines`,C.trim()),d!==``&&(l=new J(`menclose`,[l]),l.setAttribute(`notation`,d.trim())),e.arraystretch&&e.arraystretch<1&&(l=new J(`mstyle`,[l]),l.setAttribute(`scriptlevel`,`1`)),l},Am=function(e,t){e.envName.includes(`ed`)||Sm(e);var n=[],r=e.envName.includes(`at`)?`alignat`:`align`,i=e.envName===`split`,a=Tm(e.parser,{cols:n,addJot:!0,autoTag:i?void 0:wm(e.envName),emptySingleRow:!0,colSeparationType:r,maxNumCols:i?2:void 0,leqno:e.parser.settings.leqno},`display`),o=0,s=0,c={type:`ordgroup`,mode:e.mode,body:[]};if(t[0]&&t[0].type===`ordgroup`){for(var l=``,u=0;u<t[0].body.length;u++){var d=Y(t[0].body[u],`textord`);l+=d.text}o=Number(l),s=o*2}var f=!s;a.body.forEach(function(e){for(var t=1;t<e.length;t+=2)Y(Y(e[t],`styling`).body[0],`ordgroup`).body.unshift(c);if(f)s<e.length&&(s=e.length);else{var n=e.length/2;if(o<n)throw new N(`Too many math in a row: `+(`expected `+o+`, but got `+n),e[0])}});for(var p=0;p<s;++p){var m=`r`,h=0;p%2==1?m=`l`:p>0&&f&&(h=1),n[p]={type:`align`,align:m,pregap:h,postgap:0}}return a.colSeparationType=f?`align`:`alignat`,a};_m({type:`array`,names:[`array`,`darray`],props:{numArgs:1},handler(e,t){var n=(pp(t[0])?[t[0]]:Y(t[0],`ordgroup`).body).map(function(e){var t=fp(e).text;if(`lcr`.includes(t))return{type:`align`,align:t};if(t===`|`)return{type:`separator`,separator:`|`};if(t===`:`)return{type:`separator`,separator:`:`};throw new N(`Unknown column alignment: `+t,e)}),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return Tm(e.parser,r,Em(e.envName))},htmlBuilder:Dm,mathmlBuilder:km}),_m({type:`array`,names:[`matrix`,`pmatrix`,`bmatrix`,`Bmatrix`,`vmatrix`,`Vmatrix`,`matrix*`,`pmatrix*`,`bmatrix*`,`Bmatrix*`,`vmatrix*`,`Vmatrix*`],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:[`(`,`)`],bmatrix:[`[`,`]`],Bmatrix:[`\\{`,`\\}`],vmatrix:[`|`,`|`],Vmatrix:[`\\Vert`,`\\Vert`]}[e.envName.replace(`*`,``)],n=`c`,r={hskipBeforeAndAfter:!1,cols:[{type:`align`,align:n}]};if(e.envName.charAt(e.envName.length-1)===`*`){var i=e.parser;if(i.consumeSpaces(),i.fetch().text===`[`){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,!`lcr`.includes(n))throw new N(`Expected l or c or r`,i.nextToken);i.consume(),i.consumeSpaces(),i.expect(`]`),i.consume(),r.cols=[{type:`align`,align:n}]}}var a=Tm(e.parser,r,Em(e.envName)),o=Math.max(0,...a.body.map(e=>e.length));return a.cols=Array(o).fill({type:`align`,align:n}),t?{type:`leftright`,mode:e.mode,body:[a],left:t[0],right:t[1],rightColor:void 0}:a},htmlBuilder:Dm,mathmlBuilder:km}),_m({type:`array`,names:[`smallmatrix`],props:{numArgs:0},handler(e){var t=Tm(e.parser,{arraystretch:.5},`script`);return t.colSeparationType=`small`,t},htmlBuilder:Dm,mathmlBuilder:km}),_m({type:`array`,names:[`subarray`],props:{numArgs:1},handler(e,t){var n=(pp(t[0])?[t[0]]:Y(t[0],`ordgroup`).body).map(function(e){var t=fp(e).text;if(`lc`.includes(t))return{type:`align`,align:t};throw new N(`Unknown column alignment: `+t,e)});if(n.length>1)throw new N(`{subarray} can contain only one column`);var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5},i=Tm(e.parser,r,`script`);if(i.body.length>0&&i.body[0].length>1)throw new N(`{subarray} can contain only one column`);return i},htmlBuilder:Dm,mathmlBuilder:km}),_m({type:`array`,names:[`cases`,`dcases`,`rcases`,`drcases`],props:{numArgs:0},handler(e){var t=Tm(e.parser,{arraystretch:1.2,cols:[{type:`align`,align:`l`,pregap:0,postgap:1},{type:`align`,align:`l`,pregap:0,postgap:0}]},Em(e.envName));return{type:`leftright`,mode:e.mode,body:[t],left:e.envName.includes(`r`)?`.`:`\\{`,right:e.envName.includes(`r`)?`\\}`:`.`,rightColor:void 0}},htmlBuilder:Dm,mathmlBuilder:km}),_m({type:`array`,names:[`align`,`align*`,`aligned`,`split`],props:{numArgs:0},handler:Am,htmlBuilder:Dm,mathmlBuilder:km}),_m({type:`array`,names:[`gathered`,`gather`,`gather*`],props:{numArgs:0},handler(e){Cm.has(e.envName)&&Sm(e);var t={cols:[{type:`align`,align:`c`}],addJot:!0,colSeparationType:`gather`,autoTag:wm(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Tm(e.parser,t,`display`)},htmlBuilder:Dm,mathmlBuilder:km}),_m({type:`array`,names:[`alignat`,`alignat*`,`alignedat`],props:{numArgs:1},handler:Am,htmlBuilder:Dm,mathmlBuilder:km}),_m({type:`array`,names:[`equation`,`equation*`],props:{numArgs:0},handler(e){Sm(e);var t={autoTag:wm(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Tm(e.parser,t,`display`)},htmlBuilder:Dm,mathmlBuilder:km}),_m({type:`array`,names:[`CD`],props:{numArgs:0},handler(e){return Sm(e),Dp(e.parser)},htmlBuilder:Dm,mathmlBuilder:km}),X(`\\nonumber`,`\\gdef\\@eqnsw{0}`),X(`\\notag`,`\\nonumber`),q({type:`text`,names:[`\\hline`,`\\hdashline`],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new N(e.funcName+` valid only within array environment`)}});var jm=gm;q({type:`environment`,names:[`\\begin`,`\\end`],props:{numArgs:1,argTypes:[`text`]},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];if(i.type!==`ordgroup`)throw new N(`Invalid environment name`,i);for(var a=``,o=0;o<i.body.length;++o)a+=Y(i.body[o],`textord`).text;if(r===`\\begin`){if(!jm.hasOwnProperty(a))throw new N(`No such environment: `+a,i);var s=jm[a],{args:c,optArgs:l}=n.parseArguments(`\\begin{`+a+`}`,s),u={mode:n.mode,envName:a,parser:n},d=s.handler(u,c,l);n.expect(`\\end`,!1);var f=n.nextToken,p=Y(n.parseFunction(),`environment`);if(p.name!==a)throw new N(`Mismatch: \\begin{`+a+`} matched by \\end{`+p.name+`}`,f);return d}return{type:`environment`,mode:n.mode,name:a,nameGroup:i}}});var Mm=(e,t)=>{var n=e.font,r=t.withFont(n);return Mf(e.body,r)},Nm=(e,t)=>{var n=e.font,r=t.withFont(n);return qf(e.body,r)},Pm={"\\Bbb":`\\mathbb`,"\\bold":`\\mathbf`,"\\frak":`\\mathfrak`};q({type:`font`,names:[`\\mathrm`,`\\mathit`,`\\mathbf`,`\\mathnormal`,`\\mathsfit`,`\\mathbb`,`\\mathcal`,`\\mathfrak`,`\\mathscr`,`\\mathsf`,`\\mathtt`,`\\Bbb`,`\\bold`,`\\frak`],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=bf(t[0]),a=r;return a in Pm&&(a=Pm[a]),{type:`font`,mode:n.mode,font:a.slice(1),body:i}},htmlBuilder:Mm,mathmlBuilder:Nm}),q({type:`mclass`,names:[`\\boldsymbol`,`\\bm`],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`mclass`,mode:n.mode,mclass:xp(r),body:[{type:`font`,mode:n.mode,font:`boldsymbol`,body:r}],isCharacterBox:Hl(r)}}}),q({type:`font`,names:[`\\rm`,`\\sf`,`\\tt`,`\\bf`,`\\it`,`\\cal`],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:i}=e,{mode:a}=n,o=n.parseExpression(!0,i);return{type:`font`,mode:a,font:`math`+r.slice(1),body:{type:`ordgroup`,mode:n.mode,body:o}}},htmlBuilder:Mm,mathmlBuilder:Nm});var Fm=(e,t)=>{var n=t.style,r=n.fracNum(),i=n.fracDen(),a=t.havingStyle(r),o=Mf(e.numer,a,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,c=3.5/t.fontMetrics().ptPerEm;o.height=o.height<s?s:o.height,o.depth=o.depth<c?c:o.depth}a=t.havingStyle(i);var l=Mf(e.denom,a,t),u,d,f;e.hasBarLine?(e.barSize?(d=Nu(e.barSize,t),u=$d(`frac-line`,t,d)):u=$d(`frac-line`,t),d=u.height,f=u.height):(u=null,d=0,f=t.fontMetrics().defaultRuleThickness);var p,m,h;n.size===P.DISPLAY.size?(p=t.fontMetrics().num1,m=d>0?3*f:7*f,h=t.fontMetrics().denom1):(d>0?(p=t.fontMetrics().num2,m=f):(p=t.fontMetrics().num3,m=3*f),h=t.fontMetrics().denom2);var g;if(u){var _=t.fontMetrics().axisHeight;p-o.depth-(_+.5*d)<m&&(p+=m-(p-o.depth-(_+.5*d))),_-.5*d-(l.height-h)<m&&(h+=m-(_-.5*d-(l.height-h)));var v=-(_-.5*d);g=af({positionType:`individualShift`,children:[{type:`elem`,elem:l,shift:h},{type:`elem`,elem:u,shift:v},{type:`elem`,elem:o,shift:-p}]})}else{var y=p-o.depth-(l.height-h);y<m&&(p+=.5*(m-y),h+=.5*(m-y)),g=af({positionType:`individualShift`,children:[{type:`elem`,elem:l,shift:h},{type:`elem`,elem:o,shift:-p}]})}a=t.havingStyle(n),g.height*=a.sizeMultiplier/t.sizeMultiplier,g.depth*=a.sizeMultiplier/t.sizeMultiplier;var b=n.size===P.DISPLAY.size?t.fontMetrics().delim1:n.size===P.SCRIPTSCRIPT.size?t.havingStyle(P.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,x=e.leftDelim==null?jf(t,[`mopen`]):sm(e.leftDelim,b,!0,t.havingStyle(n),e.mode,[`mopen`]),S=e.continued?K([]):e.rightDelim==null?jf(t,[`mclose`]):sm(e.rightDelim,b,!0,t.havingStyle(n),e.mode,[`mclose`]);return K([`mord`].concat(a.sizingClasses(t)),[x,K([`mfrac`],[g]),S],t)},Im=(e,t)=>{var n=new J(`mfrac`,[qf(e.numer,t),qf(e.denom,t)]);if(!e.hasBarLine)n.setAttribute(`linethickness`,`0px`);else if(e.barSize){var r=Nu(e.barSize,t);n.setAttribute(`linethickness`,F(r))}if(e.leftDelim!=null||e.rightDelim!=null){var i=[];if(e.leftDelim!=null){var a=new J(`mo`,[new If(e.leftDelim.replace(`\\`,``))]);a.setAttribute(`fence`,`true`),i.push(a)}if(i.push(n),e.rightDelim!=null){var o=new J(`mo`,[new If(e.rightDelim.replace(`\\`,``))]);o.setAttribute(`fence`,`true`),i.push(o)}return Vf(i)}return n},Lm=(e,t)=>t?{type:`styling`,mode:e.mode,style:t,body:[e]}:e;q({type:`genfrac`,names:[`\\cfrac`,`\\dfrac`,`\\frac`,`\\tfrac`,`\\dbinom`,`\\binom`,`\\tbinom`,`\\\\atopfrac`,`\\\\bracefrac`,`\\\\brackfrac`],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=t[1],o,s=null,c=null;switch(r){case`\\cfrac`:case`\\dfrac`:case`\\frac`:case`\\tfrac`:o=!0;break;case`\\\\atopfrac`:o=!1;break;case`\\dbinom`:case`\\binom`:case`\\tbinom`:o=!1,s=`(`,c=`)`;break;case`\\\\bracefrac`:o=!1,s=`\\{`,c=`\\}`;break;case`\\\\brackfrac`:o=!1,s=`[`,c=`]`;break;default:throw Error(`Unrecognized genfrac command`)}var l=r===`\\cfrac`,u=null;return l||r.startsWith(`\\d`)?u=`display`:r.startsWith(`\\t`)&&(u=`text`),Lm({type:`genfrac`,mode:n.mode,numer:i,denom:a,continued:l,hasBarLine:o,leftDelim:s,rightDelim:c,barSize:null},u)},htmlBuilder:Fm,mathmlBuilder:Im}),q({type:`infix`,names:[`\\over`,`\\choose`,`\\atop`,`\\brace`,`\\brack`],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:n,token:r}=e,i;switch(n){case`\\over`:i=`\\frac`;break;case`\\choose`:i=`\\binom`;break;case`\\atop`:i=`\\\\atopfrac`;break;case`\\brace`:i=`\\\\bracefrac`;break;case`\\brack`:i=`\\\\brackfrac`;break;default:throw Error(`Unrecognized infix genfrac command`)}return{type:`infix`,mode:t.mode,replaceWith:i,token:r}}});var Rm=[`display`,`text`,`script`,`scriptscript`],zm=function(e){var t=null;return e.length>0&&(t=e,t=t===`.`?null:t),t};q({type:`genfrac`,names:[`\\genfrac`],props:{numArgs:6,allowedInArgument:!0,argTypes:[`math`,`math`,`size`,`text`,`math`,`math`]},handler(e,t){var{parser:n}=e,r=t[4],i=t[5],a=bf(t[0]),o=a.type===`atom`&&a.family===`open`?zm(a.text):null,s=bf(t[1]),c=s.type===`atom`&&s.family===`close`?zm(s.text):null,l=Y(t[2],`size`),u,d=null;l.isBlank?u=!0:(d=l.value,u=d.number>0);var f=null,p=t[3];if(p.type===`ordgroup`){if(p.body.length>0){var m=Y(p.body[0],`textord`);f=Rm[Number(m.text)]}}else p=Y(p,`textord`),f=Rm[Number(p.text)];return Lm({type:`genfrac`,mode:n.mode,numer:r,denom:i,continued:!1,hasBarLine:u,barSize:d,leftDelim:o,rightDelim:c},f)}}),q({type:`infix`,names:[`\\above`],props:{numArgs:1,argTypes:[`size`],infix:!0},handler(e,t){var{parser:n,funcName:r,token:i}=e;return{type:`infix`,mode:n.mode,replaceWith:`\\\\abovefrac`,size:Y(t[0],`size`).value,token:i}}}),q({type:`genfrac`,names:[`\\\\abovefrac`],props:{numArgs:3,argTypes:[`math`,`size`,`math`]},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=Y(t[1],`infix`).size;if(!a)throw Error(`\\\\abovefrac expected size, but got `+String(a));var o=t[2],s=a.number>0;return{type:`genfrac`,mode:n.mode,numer:i,denom:o,continued:!1,hasBarLine:s,barSize:a,leftDelim:null,rightDelim:null}}});var Bm=(e,t)=>{var n=t.style,r,i;e.type===`supsub`?(r=e.sup?Mf(e.sup,t.havingStyle(n.sup()),t):Mf(e.sub,t.havingStyle(n.sub()),t),i=Y(e.base,`horizBrace`)):i=Y(e,`horizBrace`);var a=Mf(i.base,t.havingBaseStyle(P.DISPLAY)),o=sp(i,t),s=i.isOver?af({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:.1},{type:`elem`,elem:o,wrapperClasses:[`svg-align`]}]}):af({positionType:`bottom`,positionData:a.depth+.1+o.height,children:[{type:`elem`,elem:o,wrapperClasses:[`svg-align`]},{type:`kern`,size:.1},{type:`elem`,elem:a}]});if(r){var c=K([`minner`,i.isOver?`mover`:`munder`],[s],t);s=i.isOver?af({positionType:`firstBaseline`,children:[{type:`elem`,elem:c},{type:`kern`,size:.2},{type:`elem`,elem:r}]}):af({positionType:`bottom`,positionData:c.depth+.2+r.height+r.depth,children:[{type:`elem`,elem:r},{type:`kern`,size:.2},{type:`elem`,elem:c}]})}return K([`minner`,i.isOver?`mover`:`munder`],[s],t)};q({type:`horizBrace`,names:[`\\overbrace`,`\\underbrace`,`\\overbracket`,`\\underbracket`],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:`horizBrace`,mode:n.mode,label:r,isOver:r.includes(`\\over`),base:t[0]}},htmlBuilder:Bm,mathmlBuilder:(e,t)=>{var n=ip(e.label);return new J(e.isOver?`mover`:`munder`,[qf(e.base,t),n])}}),q({type:`href`,names:[`\\href`],props:{numArgs:2,argTypes:[`url`,`original`],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],i=Y(t[0],`url`).url;return n.settings.isTrusted({command:`\\href`,url:i})?{type:`href`,mode:n.mode,href:i,body:xf(r)}:n.formatUnsupportedCmd(`\\href`)},htmlBuilder:(e,t)=>{var n=Ef(e.body,t,!1);return ef(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=Kf(e.body,t);return n instanceof J||(n=new J(`mrow`,[n])),n.setAttribute(`href`,e.href),n}}),q({type:`href`,names:[`\\url`],props:{numArgs:1,argTypes:[`url`],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=Y(t[0],`url`).url;if(!n.settings.isTrusted({command:`\\url`,url:r}))return n.formatUnsupportedCmd(`\\url`);for(var i=[],a=0;a<r.length;a++){var o=r[a];o===`~`&&(o=`\\textasciitilde`),i.push({type:`textord`,mode:`text`,text:o})}var s={type:`text`,mode:n.mode,font:`\\texttt`,body:i};return{type:`href`,mode:n.mode,href:r,body:xf(s)}}}),q({type:`hbox`,names:[`\\hbox`],props:{numArgs:1,argTypes:[`text`],allowedInText:!0,primitive:!0},handler(e,t){var{parser:n}=e;return{type:`hbox`,mode:n.mode,body:xf(t[0])}},htmlBuilder(e,t){return tf(Ef(e.body,t.withFont(``),!1))},mathmlBuilder(e,t){return new J(`mrow`,Gf(e.body,t.withFont(``)))}}),q({type:`html`,names:[`\\htmlClass`,`\\htmlId`,`\\htmlStyle`,`\\htmlData`],props:{numArgs:2,argTypes:[`raw`,`original`],allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,token:i}=e,a=Y(t[0],`raw`).string,o=t[1];n.settings.strict&&n.settings.reportNonstrict(`htmlExtension`,`HTML extension is disabled on strict mode`);var s,c={};switch(r){case`\\htmlClass`:c.class=a,s={command:`\\htmlClass`,class:a};break;case`\\htmlId`:c.id=a,s={command:`\\htmlId`,id:a};break;case`\\htmlStyle`:c.style=a,s={command:`\\htmlStyle`,style:a};break;case`\\htmlData`:for(var l=a.split(`,`),u=0;u<l.length;u++){var d=l[u],f=d.indexOf(`=`);if(f<0)throw new N(`\\htmlData key/value '`+d+`' missing equals sign`);var p=d.slice(0,f),m=d.slice(f+1);c[`data-`+p.trim()]=m}s={command:`\\htmlData`,attributes:c};break;default:throw Error(`Unrecognized html command`)}return n.settings.isTrusted(s)?{type:`html`,mode:n.mode,attributes:c,body:xf(o)}:n.formatUnsupportedCmd(r)},htmlBuilder:(e,t)=>{var n=Ef(e.body,t,!1),r=[`enclosing`];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=K(r,n,t);for(var a in e.attributes)a!==`class`&&e.attributes.hasOwnProperty(a)&&i.setAttribute(a,e.attributes[a]);return i},mathmlBuilder:(e,t)=>Kf(e.body,t)}),q({type:`htmlmathml`,names:[`\\html@mathml`],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:`htmlmathml`,mode:n.mode,html:xf(t[0]),mathml:xf(t[1])}},htmlBuilder:(e,t)=>tf(Ef(e.html,t,!1)),mathmlBuilder:(e,t)=>Kf(e.mathml,t)});var Vm=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:`bp`};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new N(`Invalid size: '`+e+`' in \\includegraphics`);var n={number:+(t[1]+t[2]),unit:t[3]};if(!Mu(n))throw new N(`Invalid unit: '`+n.unit+`' in \\includegraphics.`);return n};q({type:`includegraphics`,names:[`\\includegraphics`],props:{numArgs:1,numOptionalArgs:1,argTypes:[`raw`,`url`],allowedInText:!1},handler:(e,t,n)=>{var{parser:r}=e,i={number:0,unit:`em`},a={number:.9,unit:`em`},o={number:0,unit:`em`},s=``;if(n[0])for(var c=Y(n[0],`raw`).string.split(`,`),l=0;l<c.length;l++){var u=c[l].split(`=`);if(u.length===2){var d=u[1].trim();switch(u[0].trim()){case`alt`:s=d;break;case`width`:i=Vm(d);break;case`height`:a=Vm(d);break;case`totalheight`:o=Vm(d);break;default:throw new N(`Invalid key: '`+u[0]+`' in \\includegraphics.`)}}}var f=Y(t[0],`url`).url;return s===``&&(s=f,s=s.replace(/^.*[\\/]/,``),s=s.substring(0,s.lastIndexOf(`.`))),r.settings.isTrusted({command:`\\includegraphics`,url:f})?{type:`includegraphics`,mode:r.mode,alt:s,width:i,height:a,totalheight:o,src:f}:r.formatUnsupportedCmd(`\\includegraphics`)},htmlBuilder:(e,t)=>{var n=Nu(e.height,t),r=0;e.totalheight.number>0&&(r=Nu(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=Nu(e.width,t));var a={height:F(n+r)};i>0&&(a.width=F(i)),r>0&&(a.verticalAlign=F(-r));var o=new Hu(e.src,e.alt,a);return o.height=n,o.depth=r,o},mathmlBuilder:(e,t)=>{var n=new J(`mglyph`,[]);n.setAttribute(`alt`,e.alt);var r=Nu(e.height,t),i=0;if(e.totalheight.number>0&&(i=Nu(e.totalheight,t)-r,n.setAttribute(`valign`,F(-i))),n.setAttribute(`height`,F(r+i)),e.width.number>0){var a=Nu(e.width,t);n.setAttribute(`width`,F(a))}return n.setAttribute(`src`,e.src),n}}),q({type:`kern`,names:[`\\kern`,`\\mkern`,`\\hskip`,`\\mskip`],props:{numArgs:1,argTypes:[`size`],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=Y(t[0],`size`);if(n.settings.strict){var a=r[1]===`m`,o=i.value.unit===`mu`;a?(o||n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` supports only mu units, `+(`not `+i.value.unit+` units`)),n.mode!==`math`&&n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` works only in math mode`)):o&&n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` doesn't support mu units`)}return{type:`kern`,mode:n.mode,dimension:i.value}},htmlBuilder(e,t){return of(e.dimension,t)},mathmlBuilder(e,t){return new Lf(Nu(e.dimension,t))}}),q({type:`lap`,names:[`\\mathllap`,`\\mathrlap`,`\\mathclap`],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:`lap`,mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;e.alignment===`clap`?(n=K([],[Mf(e.body,t)]),n=K([`inner`],[n],t)):n=K([`inner`],[Mf(e.body,t)]);var r=K([`fix`],[]),i=K([e.alignment],[n,r],t),a=K([`strut`]);return a.style.height=F(i.height+i.depth),i.depth&&(a.style.verticalAlign=F(-i.depth)),i.children.unshift(a),i=K([`thinbox`],[i],t),K([`mord`,`vbox`],[i],t)},mathmlBuilder:(e,t)=>{var n=new J(`mpadded`,[qf(e.body,t)]);if(e.alignment!==`rlap`){var r=e.alignment===`llap`?`-1`:`-0.5`;n.setAttribute(`lspace`,r+`width`)}return n.setAttribute(`width`,`0px`),n}}),q({type:`styling`,names:[`\\(`,`$`],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,i=r.mode;r.switchMode(`math`);var a=n===`\\(`?`\\)`:`$`,o=r.parseExpression(!1,a);return r.expect(a),r.switchMode(i),{type:`styling`,mode:r.mode,style:`text`,resetFont:!0,body:o}}}),q({type:`text`,names:[`\\)`,`\\]`],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new N(`Mismatched `+e.funcName)}});var Hm=(e,t)=>{switch(t.style.size){case P.DISPLAY.size:return e.display;case P.TEXT.size:return e.text;case P.SCRIPT.size:return e.script;case P.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};q({type:`mathchoice`,names:[`\\mathchoice`],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:`mathchoice`,mode:n.mode,display:xf(t[0]),text:xf(t[1]),script:xf(t[2]),scriptscript:xf(t[3])}},htmlBuilder:(e,t)=>tf(Ef(Hm(e,t),t,!1)),mathmlBuilder:(e,t)=>Kf(Hm(e,t),t)});var Um=(e,t,n,r,i,a,o)=>{e=K([],[e]);var s=n&&Hl(n),c,l;if(t){var u=Mf(t,r.havingStyle(i.sup()),r);l={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var d=Mf(n,r.havingStyle(i.sub()),r);c={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}var f;if(l&&c)f=af({positionType:`bottom`,positionData:r.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+e.depth+o,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:F(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:F(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]});else if(c)f=af({positionType:`top`,positionData:e.height-o,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:F(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e}]});else if(l)f=af({positionType:`bottom`,positionData:e.depth+o,children:[{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:F(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]});else return e;var p=[f];if(c&&a!==0&&!s){var m=K([`mspace`],[],r);m.style.marginRight=F(a),p.unshift(m)}return K([`mop`,`op-limits`],p,r)},Wm=new Set([`\\smallint`]),Gm=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=Y(e.base,`op`),i=!0):a=Y(e,`op`);var o=t.style,s=!1;o.size===P.DISPLAY.size&&a.symbol&&!Wm.has(a.name)&&(s=!0);var c,l;if(a.symbol){var u=s?`Size2-Regular`:`Size1-Regular`,d=``;if((a.name===`\\oiint`||a.name===`\\oiiint`)&&(d=a.name.slice(1),a.name=d===`oiint`?`\\iint`:`\\iiint`),c=Gd(a.name,u,`math`,t,[`mop`,`op-symbol`,s?`large-op`:`small-op`]),l=c.italic,d.length>0){var f=uf(d+`Size`+(s?`2`:`1`),t);c=af({positionType:`individualShift`,children:[{type:`elem`,elem:c,shift:0},{type:`elem`,elem:f,shift:s?.08:0}]}),a.name=`\\`+d,c.classes.unshift(`mop`),c.italic=l}}else if(a.body){var p=Ef(a.body,t,!0);p.length===1&&p[0]instanceof Wu?(c=p[0],c.classes[0]=`mop`):c=K([`mop`],p,t)}else{for(var m=[],h=1;h<a.name.length;h++)m.push(Kd(a.name[h],a.mode,t));c=K([`mop`],m,t)}var g=0,_=0;return(c instanceof Wu||a.name===`\\oiint`||a.name===`\\oiiint`)&&!a.suppressBaseShift&&(g=(c.height-c.depth)/2-t.fontMetrics().axisHeight,_=c.italic??0),i?Um(c,n,r,t,o,_,g):(g&&(c.style.position=`relative`,c.style.top=F(g)),c)},Km=(e,t)=>{var n;if(e.symbol)n=new J(`mo`,[Bf(e.name,e.mode)]),Wm.has(e.name)&&n.setAttribute(`largeop`,`false`);else if(e.body)n=new J(`mo`,Gf(e.body,t));else{n=new J(`mi`,[new If(e.name.slice(1))]);var r=new J(`mo`,[Bf(``,`text`)]);n=e.parentIsSupSub?new J(`mrow`,[n,r]):Ff([n,r])}return n},qm={"∏":`\\prod`,"∐":`\\coprod`,"∑":`\\sum`,"⋀":`\\bigwedge`,"⋁":`\\bigvee`,"⋂":`\\bigcap`,"⋃":`\\bigcup`,"⨀":`\\bigodot`,"⨁":`\\bigoplus`,"⨂":`\\bigotimes`,"⨄":`\\biguplus`,"⨆":`\\bigsqcup`};q({type:`op`,names:`\\coprod.\\bigvee.\\bigwedge.\\biguplus.\\bigcap.\\bigcup.\\intop.\\prod.\\sum.\\bigotimes.\\bigoplus.\\bigodot.\\bigsqcup.\\smallint.∏.∐.∑.⋀.⋁.⋂.⋃.⨀.⨁.⨂.⨄.⨆`.split(`.`),props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=r;return i.length===1&&(i=qm[i]),{type:`op`,mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:Gm,mathmlBuilder:Km}),q({type:`op`,names:[`\\mathop`],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`op`,mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:xf(r)}},htmlBuilder:Gm,mathmlBuilder:Km});var Jm={"∫":`\\int`,"∬":`\\iint`,"∭":`\\iiint`,"∮":`\\oint`,"∯":`\\oiint`,"∰":`\\oiiint`};q({type:`op`,names:`\\arcsin.\\arccos.\\arctan.\\arctg.\\arcctg.\\arg.\\ch.\\cos.\\cosec.\\cosh.\\cot.\\cotg.\\coth.\\csc.\\ctg.\\cth.\\deg.\\dim.\\exp.\\hom.\\ker.\\lg.\\ln.\\log.\\sec.\\sin.\\sinh.\\sh.\\tan.\\tanh.\\tg.\\th`.split(`.`),props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:Gm,mathmlBuilder:Km}),q({type:`op`,names:[`\\det`,`\\gcd`,`\\inf`,`\\lim`,`\\max`,`\\min`,`\\Pr`,`\\sup`],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:`op`,mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:Gm,mathmlBuilder:Km}),q({type:`op`,names:[`\\int`,`\\iint`,`\\iiint`,`\\oint`,`\\oiint`,`\\oiiint`,`∫`,`∬`,`∭`,`∮`,`∯`,`∰`],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:t,funcName:n}=e,r=n;return r.length===1&&(r=Jm[r]),{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:Gm,mathmlBuilder:Km});var Ym=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=Y(e.base,`operatorname`),i=!0):a=Y(e,`operatorname`);var o;if(a.body.length>0){for(var s=Ef(a.body.map(e=>{var t=`text`in e?e.text:void 0;return typeof t==`string`?{type:`textord`,mode:e.mode,text:t}:e}),t.withFont(`mathrm`),!0),c=0;c<s.length;c++){var l=s[c];l instanceof Wu&&(l.text=l.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`))}o=K([`mop`],s,t)}else o=K([`mop`],[],t);return i?Um(o,n,r,t,t.style,0,0):o};q({type:`operatorname`,names:[`\\operatorname@`,`\\operatornamewithlimits`],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:`operatorname`,mode:n.mode,body:xf(i),alwaysHandleSupSub:r===`\\operatornamewithlimits`,limits:!1,parentIsSupSub:!1}},htmlBuilder:Ym,mathmlBuilder:(e,t)=>{for(var n=Gf(e.body,t.withFont(`mathrm`)),r=!0,i=0;i<n.length;i++){var a=n[i];if(!(a instanceof Lf))if(a instanceof J)switch(a.type){case`mi`:case`mn`:case`mspace`:case`mtext`:break;case`mo`:var o=a.children[0];a.children.length===1&&o instanceof If?o.text=o.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`):r=!1;break;default:r=!1}else r=!1}r&&(n=[new If(n.map(e=>e.toText()).join(``))]);var s=new J(`mi`,n);s.setAttribute(`mathvariant`,`normal`);var c=new J(`mo`,[Bf(``,`text`)]);return e.parentIsSupSub?new J(`mrow`,[s,c]):Ff([s,c])}}),X(`\\operatorname`,`\\@ifstar\\operatornamewithlimits\\operatorname@`),yf({type:`ordgroup`,htmlBuilder(e,t){return e.semisimple?tf(Ef(e.body,t,!1)):K([`mord`],Ef(e.body,t,!0),t)},mathmlBuilder(e,t){return Kf(e.body,t,!0)}}),q({type:`overline`,names:[`\\overline`],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:`overline`,mode:n.mode,body:r}},htmlBuilder(e,t){var n=Mf(e.body,t.havingCrampedStyle()),r=$d(`overline-line`,t),i=t.fontMetrics().defaultRuleThickness;return K([`mord`,`overline`],[af({positionType:`firstBaseline`,children:[{type:`elem`,elem:n},{type:`kern`,size:3*i},{type:`elem`,elem:r},{type:`kern`,size:i}]})],t)},mathmlBuilder(e,t){var n=new J(`mo`,[new If(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new J(`mover`,[qf(e.body,t),n]);return r.setAttribute(`accent`,`true`),r}}),q({type:`phantom`,names:[`\\phantom`],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`phantom`,mode:n.mode,body:xf(r)}},htmlBuilder:(e,t)=>tf(Ef(e.body,t.withPhantom(),!1)),mathmlBuilder:(e,t)=>new J(`mphantom`,Gf(e.body,t))}),X(`\\hphantom`,`\\smash{\\phantom{#1}}`),q({type:`vphantom`,names:[`\\vphantom`],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`vphantom`,mode:n.mode,body:r}},htmlBuilder:(e,t)=>K([`mord`,`rlap`],[K([`inner`],[Mf(e.body,t.withPhantom())]),K([`fix`],[])],t),mathmlBuilder:(e,t)=>{var n=new J(`mpadded`,[new J(`mphantom`,Gf(xf(e.body),t))]);return n.setAttribute(`width`,`0px`),n}}),q({type:`raisebox`,names:[`\\raisebox`],props:{numArgs:2,argTypes:[`size`,`hbox`],allowedInText:!0},handler(e,t){var{parser:n}=e,r=Y(t[0],`size`).value,i=t[1];return{type:`raisebox`,mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=Mf(e.body,t);return af({positionType:`shift`,positionData:-Nu(e.dy,t),children:[{type:`elem`,elem:n}]})},mathmlBuilder(e,t){var n=new J(`mpadded`,[qf(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute(`voffset`,r),n}}),q({type:`internal`,names:[`\\relax`],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:`internal`,mode:t.mode}}}),q({type:`rule`,names:[`\\rule`],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`size`,`size`,`size`]},handler(e,t,n){var{parser:r}=e,i=n[0],a=Y(t[0],`size`),o=Y(t[1],`size`);return{type:`rule`,mode:r.mode,shift:i&&Y(i,`size`).value,width:a.value,height:o.value}},htmlBuilder(e,t){var n=K([`mord`,`rule`],[],t),r=Nu(e.width,t),i=Nu(e.height,t),a=e.shift?Nu(e.shift,t):0;return n.style.borderRightWidth=F(r),n.style.borderTopWidth=F(i),n.style.bottom=F(a),n.width=r,n.height=i+a,n.depth=-a,n.maxFontSize=i*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=Nu(e.width,t),r=Nu(e.height,t),i=e.shift?Nu(e.shift,t):0,a=t.color&&t.getColor()||`black`,o=new J(`mspace`);o.setAttribute(`mathbackground`,a),o.setAttribute(`width`,F(n)),o.setAttribute(`height`,F(r));var s=new J(`mpadded`,[o]);return i>=0?s.setAttribute(`height`,F(i)):(s.setAttribute(`height`,F(i)),s.setAttribute(`depth`,F(-i))),s.setAttribute(`voffset`,F(i)),s}});function Xm(e,t,n){for(var r=Ef(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,a=0;a<r.length;a++){var o=r[a].classes.indexOf(`sizing`);o<0?Array.prototype.push.apply(r[a].classes,t.sizingClasses(n)):r[a].classes[o+1]===`reset-size`+t.size&&(r[a].classes[o+1]=`reset-size`+n.size),r[a].height*=i,r[a].depth*=i}return tf(r)}var Zm=[`\\tiny`,`\\sixptsize`,`\\scriptsize`,`\\footnotesize`,`\\small`,`\\normalsize`,`\\large`,`\\Large`,`\\LARGE`,`\\huge`,`\\Huge`];q({type:`sizing`,names:Zm,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!1,n);return{type:`sizing`,mode:i.mode,size:Zm.indexOf(r)+1,body:a}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return Xm(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=new J(`mstyle`,Gf(e.body,n));return r.setAttribute(`mathsize`,F(n.sizeMultiplier)),r}}),q({type:`smash`,names:[`\\smash`],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,i=!1,a=!1,o=n[0]&&Y(n[0],`ordgroup`);if(o)for(var s,c=0;c<o.body.length;++c){var l=o.body[c];if(s=fp(l).text,s===`t`)i=!0;else if(s===`b`)a=!0;else{i=!1,a=!1;break}}else i=!0,a=!0;var u=t[0];return{type:`smash`,mode:r.mode,body:u,smashHeight:i,smashDepth:a}},htmlBuilder:(e,t)=>{var n=K([],[Mf(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0),e.smashDepth&&(n.depth=0),e.smashHeight&&e.smashDepth)return K([`mord`,`smash`],[n],t);if(n.children)for(var r=0;r<n.children.length;r++)e.smashHeight&&(n.children[r].height=0),e.smashDepth&&(n.children[r].depth=0);return K([`mord`],[af({positionType:`firstBaseline`,children:[{type:`elem`,elem:n}]})],t)},mathmlBuilder:(e,t)=>{var n=new J(`mpadded`,[qf(e.body,t)]);return e.smashHeight&&n.setAttribute(`height`,`0px`),e.smashDepth&&n.setAttribute(`depth`,`0px`),n}}),q({type:`sqrt`,names:[`\\sqrt`],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r}=e,i=n[0],a=t[0];return{type:`sqrt`,mode:r.mode,body:a,index:i}},htmlBuilder(e,t){var n=Mf(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=nf(n,t);var r=t.fontMetrics().defaultRuleThickness,i=r;t.style.id<P.TEXT.id&&(i=t.fontMetrics().xHeight);var a=r+i/4,{span:o,ruleWidth:s,advanceWidth:c}=Xp(n.height+n.depth+a+r,t),l=o.height-s;l>n.height+n.depth+a&&(a=(a+l-n.height-n.depth)/2);var u=o.height-n.height-a-s;n.style.paddingLeft=F(c);var d=af({positionType:`firstBaseline`,children:[{type:`elem`,elem:n,wrapperClasses:[`svg-align`]},{type:`kern`,size:-(n.height+u)},{type:`elem`,elem:o},{type:`kern`,size:s}]});if(e.index){var f=t.havingStyle(P.SCRIPTSCRIPT),p=Mf(e.index,f,t);return K([`mord`,`sqrt`],[K([`root`],[af({positionType:`shift`,positionData:-(.6*(d.height-d.depth)),children:[{type:`elem`,elem:p}]})]),d],t)}else return K([`mord`,`sqrt`],[d],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new J(`mroot`,[qf(n,t),qf(r,t)]):new J(`msqrt`,[qf(n,t)])}});var Qm={display:P.DISPLAY,text:P.TEXT,script:P.SCRIPT,scriptscript:P.SCRIPTSCRIPT};function $m(e){return e in Qm}q({type:`styling`,names:[`\\displaystyle`,`\\textstyle`,`\\scriptstyle`,`\\scriptscriptstyle`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!0,n),o=r.slice(1,r.length-5);if(!$m(o))throw Error(`Unknown style: `+o);return{type:`styling`,mode:i.mode,style:o,body:a}},htmlBuilder(e,t){var n=Qm[e.style],r=t.havingStyle(n);return e.resetFont&&(r=r.withFont(``)),Xm(e.body,r,t)},mathmlBuilder(e,t){var n=Qm[e.style],r=t.havingStyle(n);e.resetFont&&(r=r.withFont(``));var i=new J(`mstyle`,Gf(e.body,r)),a={display:[`0`,`true`],text:[`0`,`false`],script:[`1`,`false`],scriptscript:[`2`,`false`]}[e.style];return i.setAttribute(`scriptlevel`,a[0]),i.setAttribute(`displaystyle`,a[1]),i}});var eh=function(e,t){var n=e.base;return n?n.type===`op`?n.limits&&(t.style.size===P.DISPLAY.size||n.alwaysHandleSupSub)?Gm:null:n.type===`operatorname`?n.alwaysHandleSupSub&&(t.style.size===P.DISPLAY.size||n.limits)?Ym:null:n.type===`accent`?Hl(n.base)?hp:null:n.type===`horizBrace`&&!e.sub===n.isOver?Bm:null:null};yf({type:`supsub`,htmlBuilder(e,t){var n=eh(e,t);if(n)return n(e,t);var{base:r,sup:i,sub:a}=e,o=Mf(r,t),s,c,l=t.fontMetrics(),u=0,d=0,f=r&&Hl(r);if(i){var p=t.havingStyle(t.style.sup());s=Mf(i,p,t),f||(u=o.height-p.fontMetrics().supDrop*p.sizeMultiplier/t.sizeMultiplier)}if(a){var m=t.havingStyle(t.style.sub());c=Mf(a,m,t),f||(d=o.depth+m.fontMetrics().subDrop*m.sizeMultiplier/t.sizeMultiplier)}var h=t.style===P.DISPLAY?l.sup1:t.style.cramped?l.sup3:l.sup2,g=t.sizeMultiplier,_=F(.5/l.ptPerEm/g),v=null;if(c){var y=e.base&&e.base.type===`op`&&e.base.name&&(e.base.name===`\\oiint`||e.base.name===`\\oiiint`);(o instanceof Wu||y)&&(v=F(-(o.italic??0)))}var b;if(s&&c){u=Math.max(u,h,s.depth+.25*l.xHeight),d=Math.max(d,l.sub2);var x=4*l.defaultRuleThickness;if(u-s.depth-(c.height-d)<x){d=x-(u-s.depth)+c.height;var S=.8*l.xHeight-(u-s.depth);S>0&&(u+=S,d-=S)}b=af({positionType:`individualShift`,children:[{type:`elem`,elem:c,shift:d,marginRight:_,marginLeft:v},{type:`elem`,elem:s,shift:-u,marginRight:_}]})}else if(c)d=Math.max(d,l.sub1,c.height-.8*l.xHeight),b=af({positionType:`shift`,positionData:d,children:[{type:`elem`,elem:c,marginLeft:v,marginRight:_}]});else if(s)u=Math.max(u,h,s.depth+.25*l.xHeight),b=af({positionType:`shift`,positionData:-u,children:[{type:`elem`,elem:s,marginRight:_}]});else throw Error(`supsub must have either sup or sub.`);return K([Af(o,`right`)||`mord`],[o,K([`msupsub`],[b])],t)},mathmlBuilder(e,t){var n=!1,r,i;e.base&&e.base.type===`horizBrace`&&(i=!!e.sup,i===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&(e.base.type===`op`||e.base.type===`operatorname`)&&(e.base.parentIsSupSub=!0);var a=[qf(e.base,t)];e.sub&&a.push(qf(e.sub,t)),e.sup&&a.push(qf(e.sup,t));var o;if(n)o=r?`mover`:`munder`;else if(!e.sub){var s=e.base;o=s&&s.type===`op`&&s.limits&&(t.style===P.DISPLAY||s.alwaysHandleSupSub)||s&&s.type===`operatorname`&&s.alwaysHandleSupSub&&(s.limits||t.style===P.DISPLAY)?`mover`:`msup`}else if(e.sup){var c=e.base;o=c&&c.type===`op`&&c.limits&&t.style===P.DISPLAY||c&&c.type===`operatorname`&&c.alwaysHandleSupSub&&(t.style===P.DISPLAY||c.limits)?`munderover`:`msubsup`}else{var l=e.base;o=l&&l.type===`op`&&l.limits&&(t.style===P.DISPLAY||l.alwaysHandleSupSub)||l&&l.type===`operatorname`&&l.alwaysHandleSupSub&&(l.limits||t.style===P.DISPLAY)?`munder`:`msub`}return new J(o,a)}}),yf({type:`atom`,htmlBuilder(e,t){return Kd(e.text,e.mode,t,[`m`+e.family])},mathmlBuilder(e,t){var n=new J(`mo`,[Bf(e.text,e.mode)]);if(e.family===`bin`){var r=Uf(e,t);r===`bold-italic`&&n.setAttribute(`mathvariant`,r)}else e.family===`punct`?n.setAttribute(`separator`,`true`):(e.family===`open`||e.family===`close`)&&n.setAttribute(`stretchy`,`false`);return n}});var th={mi:`italic`,mn:`normal`,mtext:`normal`};yf({type:`mathord`,htmlBuilder(e,t){return Jd(e,t,`mathord`)},mathmlBuilder(e,t){var n=new J(`mi`,[Bf(e.text,e.mode,t)]),r=Uf(e,t)||`italic`;return r!==th[n.type]&&n.setAttribute(`mathvariant`,r),n}}),yf({type:`textord`,htmlBuilder(e,t){return Jd(e,t,`textord`)},mathmlBuilder(e,t){var n=Bf(e.text,e.mode,t),r=Uf(e,t)||`normal`,i=e.mode===`text`?new J(`mtext`,[n]):/[0-9]/.test(e.text)?new J(`mn`,[n]):e.text===`\\prime`?new J(`mo`,[n]):new J(`mi`,[n]);return r!==th[i.type]&&i.setAttribute(`mathvariant`,r),i}});var nh={"\\nobreak":`nobreak`,"\\allowbreak":`allowbreak`},rh={" ":{},"\\ ":{},"~":{className:`nobreak`},"\\space":{},"\\nobreakspace":{className:`nobreak`}};yf({type:`spacing`,htmlBuilder(e,t){if(rh.hasOwnProperty(e.text)){var n=rh[e.text].className||``;if(e.mode===`text`){var r=Jd(e,t,`textord`);return r.classes.push(n),r}else return K([`mspace`,n],[Kd(e.text,e.mode,t)],t)}else if(nh.hasOwnProperty(e.text))return K([`mspace`,nh[e.text]],[],t);else throw new N(`Unknown type of space "`+e.text+`"`)},mathmlBuilder(e,t){var n;if(rh.hasOwnProperty(e.text))n=new J(`mtext`,[new If(`\xA0`)]);else if(nh.hasOwnProperty(e.text))return new J(`mspace`);else throw new N(`Unknown type of space "`+e.text+`"`);return n}});var ih=()=>{var e=new J(`mtd`,[]);return e.setAttribute(`width`,`50%`),e};yf({type:`tag`,mathmlBuilder(e,t){var n=new J(`mtable`,[new J(`mtr`,[ih(),new J(`mtd`,[Kf(e.body,t)]),ih(),new J(`mtd`,[Kf(e.tag,t)])])]);return n.setAttribute(`width`,`100%`),n}});var ah={"\\text":void 0,"\\textrm":`textrm`,"\\textsf":`textsf`,"\\texttt":`texttt`,"\\textnormal":`textrm`},oh={"\\textbf":`textbf`,"\\textmd":`textmd`},sh={"\\textit":`textit`,"\\textup":`textup`},ch=(e,t)=>{var n=e.font;return n?ah[n]?t.withTextFontFamily(ah[n]):oh[n]?t.withTextFontWeight(oh[n]):n===`\\emph`?t.fontShape===`textit`?t.withTextFontShape(`textup`):t.withTextFontShape(`textit`):t.withTextFontShape(sh[n]):t};q({type:`text`,names:[`\\text`,`\\textrm`,`\\textsf`,`\\texttt`,`\\textnormal`,`\\textbf`,`\\textmd`,`\\textit`,`\\textup`,`\\emph`],props:{numArgs:1,argTypes:[`text`],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:`text`,mode:n.mode,body:xf(i),font:r}},htmlBuilder(e,t){var n=ch(e,t);return K([`mord`,`text`],Ef(e.body,n,!0),n)},mathmlBuilder(e,t){var n=ch(e,t);return Kf(e.body,n)}}),q({type:`underline`,names:[`\\underline`],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:`underline`,mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Mf(e.body,t),r=$d(`underline-line`,t),i=t.fontMetrics().defaultRuleThickness;return K([`mord`,`underline`],[af({positionType:`top`,positionData:n.height,children:[{type:`kern`,size:i},{type:`elem`,elem:r},{type:`kern`,size:3*i},{type:`elem`,elem:n}]})],t)},mathmlBuilder(e,t){var n=new J(`mo`,[new If(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new J(`munder`,[qf(e.body,t),n]);return r.setAttribute(`accentunder`,`true`),r}}),q({type:`vcenter`,names:[`\\vcenter`],props:{numArgs:1,argTypes:[`original`],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:`vcenter`,mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Mf(e.body,t),r=t.fontMetrics().axisHeight;return af({positionType:`shift`,positionData:.5*(n.height-r-(n.depth+r)),children:[{type:`elem`,elem:n}]})},mathmlBuilder(e,t){return new J(`mrow`,[new J(`mpadded`,[qf(e.body,t)],[`vcenter`])])}}),q({type:`verb`,names:[`\\verb`],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new N(`\\verb ended by end of line instead of matching delimiter`)},htmlBuilder(e,t){for(var n=lh(e),r=[],i=t.havingStyle(t.style.text()),a=0;a<n.length;a++){var o=n[a];o===`~`&&(o=`\\textasciitilde`),r.push(Gd(o,`Typewriter-Regular`,e.mode,i,[`mord`,`texttt`]))}return K([`mord`,`text`].concat(i.sizingClasses(t)),Xd(r),i)},mathmlBuilder(e,t){var n=new J(`mtext`,[new If(lh(e))]);return n.setAttribute(`mathvariant`,`monospace`),n}});var lh=e=>e.body.replace(/ /g,e.star?`␣`:`\xA0`),uh=gf,dh=`[ \r
|
|
297
|
-
]`,
|
|
347
|
+
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw Error(`Unknown stretchy delimiter.`)}};function wR(e){return`toText`in e}var TR=class{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e=``,t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map(e=>{if(wR(e))return e.toText();throw Error(`Expected MathDomNode with toText, got `+e.constructor.name)}).join(``)}},ER={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},DR={ex:!0,em:!0,mu:!0},OR=function(e){return typeof e!=`string`&&(e=e.unit),e in ER||e in DR||e===`ex`},kR=function(e,t){var n;if(e.unit in ER)n=ER[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit===`mu`)n=t.fontMetrics().cssEmPerMu;else{var r=t.style.isTight()?t.havingStyle(t.style.text()):t;if(e.unit===`ex`)n=r.fontMetrics().xHeight;else if(e.unit===`em`)n=r.fontMetrics().quad;else throw new L(`Invalid unit: '`+e.unit+`'`);r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},R=function(e){return+e.toFixed(4)+`em`},AR=function(e){return e.filter(e=>e).join(` `)},jR=function(e){var t=``;for(var n of Object.keys(e)){var r=e[n];r!==void 0&&(t+=jL(n)+`:`+r+`;`)}return t},MR=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push(`mtight`);var r=t.getColor();r&&(this.style.color=r)}},NR=function(e){var t=document.createElement(e);t.className=AR(this.classes),Object.assign(t.style,this.style);for(var n of Object.keys(this.attributes))t.setAttribute(n,this.attributes[n]);for(var r=0;r<this.children.length;r++)t.appendChild(this.children[r].toNode());return t},PR=/[\s"'>/=\x00-\x1f]/,FR=function(e){var t=`<`+e;this.classes.length&&(t+=` class="`+PL(AR(this.classes))+`"`);var n=jR(this.style);n&&(t+=` style="`+PL(n)+`"`);for(var r of Object.keys(this.attributes)){if(PR.test(r))throw new L(`Invalid attribute name '`+r+`'`);t+=` `+r+`="`+PL(this.attributes[r])+`"`}t+=`>`;for(var i=0;i<this.children.length;i++)t+=this.children[i].toMarkup();return t+=`</`+e+`>`,t},IR=class{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,MR.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return NR.call(this,`span`)}toMarkup(){return FR.call(this,`span`)}},LR=class{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,MR.call(this,t,r),this.children=n||[],this.setAttribute(`href`,e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return NR.call(this,`a`)}toMarkup(){return FR.call(this,`a`)}},RR=class{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=[`mord`],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement(`img`);return e.src=this.src,e.alt=this.alt,e.className=`mord`,Object.assign(e.style,this.style),e}toMarkup(){var e=`<img src="`+PL(this.src)+`"`+(` alt="`+PL(this.alt)+`"`),t=jR(this.style);return t&&(e+=` style="`+PL(t)+`"`),e+=`'/>`,e}},zR={î:`ı̂`,ï:`ı̈`,í:`ı́`,ì:`ı̀`},BR=class{constructor(e,t,n,r,i,a,o,s){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=r||0,this.skew=i||0,this.width=a||0,this.classes=o||[],this.style=s||{},this.maxFontSize=0;var c=cR(this.text.charCodeAt(0));c&&this.classes.push(c+`_fallback`),/[îïíì]/.test(this.text)&&(this.text=zR[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;return this.italic>0&&(t=document.createElement(`span`),t.style.marginRight=R(this.italic)),this.classes.length>0&&(t||=document.createElement(`span`),t.className=AR(this.classes)),Object.keys(this.style).length>0&&(t||=document.createElement(`span`),Object.assign(t.style,this.style)),t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t=`<span`;this.classes.length&&(e=!0,t+=` class="`,t+=PL(AR(this.classes)),t+=`"`);var n=``;this.italic>0&&(n+=`margin-right:`+R(this.italic)+`;`),n+=jR(this.style),n&&(e=!0,t+=` style="`+PL(n)+`"`);var r=PL(this.text);return e?(t+=`>`,t+=r,t+=`</span>`,t):r}},VR=class{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e=`<svg xmlns="http://www.w3.org/2000/svg"`;for(var t of Object.keys(this.attributes))e+=` `+t+`="`+PL(this.attributes[t])+`"`;e+=`>`;for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+=`</svg>`,e}},HR=class{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return this.alternate?e.setAttribute(`d`,this.alternate):e.setAttribute(`d`,SR[this.pathName]),e}toMarkup(){return this.alternate?`<path d="`+PL(this.alternate)+`"/>`:`<path d="`+PL(SR[this.pathName])+`"/>`}},UR=class{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`line`);for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e=`<line`;for(var t of Object.keys(this.attributes))e+=` `+t+`="`+PL(this.attributes[t])+`"`;return e+=`/>`,e}};function WR(e){if(e instanceof BR)return e;throw Error(`Expected symbolNode but got `+String(e)+`.`)}function GR(e){if(e instanceof IR)return e;throw Error(`Expected span<HtmlDomNode> but got `+String(e)+`.`)}var KR=e=>e instanceof IR||e instanceof LR||e instanceof TR,qR={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},JR={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},YR={Å:`A`,Ð:`D`,Þ:`o`,å:`a`,ð:`d`,þ:`o`,А:`A`,Б:`B`,В:`B`,Г:`F`,Д:`A`,Е:`E`,Ж:`K`,З:`3`,И:`N`,Й:`N`,К:`K`,Л:`N`,М:`M`,Н:`H`,О:`O`,П:`N`,Р:`P`,С:`C`,Т:`T`,У:`y`,Ф:`O`,Х:`X`,Ц:`U`,Ч:`h`,Ш:`W`,Щ:`W`,Ъ:`B`,Ы:`X`,Ь:`B`,Э:`3`,Ю:`X`,Я:`R`,а:`a`,б:`b`,в:`a`,г:`r`,д:`y`,е:`e`,ж:`m`,з:`e`,и:`n`,й:`n`,к:`n`,л:`n`,м:`m`,н:`n`,о:`o`,п:`n`,р:`p`,с:`c`,т:`o`,у:`y`,ф:`b`,х:`x`,ц:`n`,ч:`n`,ш:`w`,щ:`w`,ъ:`a`,ы:`m`,ь:`a`,э:`e`,ю:`m`,я:`r`};function XR(e,t){qR[e]=t}function ZR(e,t,n){if(!qR[t])throw Error(`Font metrics not found for font: `+t+`.`);var r=e.charCodeAt(0),i=qR[t][r];if(!i&&e[0]in YR&&(r=YR[e[0]].charCodeAt(0),i=qR[t][r]),!i&&n===`text`&&uR(r)&&(i=qR[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var QR={};function $R(e){var t=e>=5?0:e>=3?1:2;if(!QR[t]){var n=QR[t]={cssEmPerMu:JR.quad[t]/18};for(var r in JR)JR.hasOwnProperty(r)&&(n[r]=JR[r][t])}return QR[t]}var ez={math:{},text:{}};function z(e,t,n,r,i,a){ez[e][i]={font:t,group:n,replace:r},a&&r&&(ez[e][r]=ez[e][i])}var B=`math`,V=`text`,H=`main`,U=`ams`,tz=`accent-token`,W=`bin`,nz=`close`,rz=`inner`,G=`mathord`,iz=`op-token`,az=`open`,oz=`punct`,K=`rel`,sz=`spacing`,q=`textord`;z(B,H,K,`≡`,`\\equiv`,!0),z(B,H,K,`≺`,`\\prec`,!0),z(B,H,K,`≻`,`\\succ`,!0),z(B,H,K,`∼`,`\\sim`,!0),z(B,H,K,`⊥`,`\\perp`),z(B,H,K,`⪯`,`\\preceq`,!0),z(B,H,K,`⪰`,`\\succeq`,!0),z(B,H,K,`≃`,`\\simeq`,!0),z(B,H,K,`∣`,`\\mid`,!0),z(B,H,K,`≪`,`\\ll`,!0),z(B,H,K,`≫`,`\\gg`,!0),z(B,H,K,`≍`,`\\asymp`,!0),z(B,H,K,`∥`,`\\parallel`),z(B,H,K,`⋈`,`\\bowtie`,!0),z(B,H,K,`⌣`,`\\smile`,!0),z(B,H,K,`⊑`,`\\sqsubseteq`,!0),z(B,H,K,`⊒`,`\\sqsupseteq`,!0),z(B,H,K,`≐`,`\\doteq`,!0),z(B,H,K,`⌢`,`\\frown`,!0),z(B,H,K,`∋`,`\\ni`,!0),z(B,H,K,`∝`,`\\propto`,!0),z(B,H,K,`⊢`,`\\vdash`,!0),z(B,H,K,`⊣`,`\\dashv`,!0),z(B,H,K,`∋`,`\\owns`),z(B,H,oz,`.`,`\\ldotp`),z(B,H,oz,`⋅`,`\\cdotp`),z(B,H,oz,`⋅`,`·`),z(V,H,q,`⋅`,`·`),z(B,H,q,`#`,`\\#`),z(V,H,q,`#`,`\\#`),z(B,H,q,`&`,`\\&`),z(V,H,q,`&`,`\\&`),z(B,H,q,`ℵ`,`\\aleph`,!0),z(B,H,q,`∀`,`\\forall`,!0),z(B,H,q,`ℏ`,`\\hbar`,!0),z(B,H,q,`∃`,`\\exists`,!0),z(B,H,q,`∇`,`\\nabla`,!0),z(B,H,q,`♭`,`\\flat`,!0),z(B,H,q,`ℓ`,`\\ell`,!0),z(B,H,q,`♮`,`\\natural`,!0),z(B,H,q,`♣`,`\\clubsuit`,!0),z(B,H,q,`℘`,`\\wp`,!0),z(B,H,q,`♯`,`\\sharp`,!0),z(B,H,q,`♢`,`\\diamondsuit`,!0),z(B,H,q,`ℜ`,`\\Re`,!0),z(B,H,q,`♡`,`\\heartsuit`,!0),z(B,H,q,`ℑ`,`\\Im`,!0),z(B,H,q,`♠`,`\\spadesuit`,!0),z(B,H,q,`§`,`\\S`,!0),z(V,H,q,`§`,`\\S`),z(B,H,q,`¶`,`\\P`,!0),z(V,H,q,`¶`,`\\P`),z(B,H,q,`†`,`\\dag`),z(V,H,q,`†`,`\\dag`),z(V,H,q,`†`,`\\textdagger`),z(B,H,q,`‡`,`\\ddag`),z(V,H,q,`‡`,`\\ddag`),z(V,H,q,`‡`,`\\textdaggerdbl`),z(B,H,nz,`⎱`,`\\rmoustache`,!0),z(B,H,az,`⎰`,`\\lmoustache`,!0),z(B,H,nz,`⟯`,`\\rgroup`,!0),z(B,H,az,`⟮`,`\\lgroup`,!0),z(B,H,W,`∓`,`\\mp`,!0),z(B,H,W,`⊖`,`\\ominus`,!0),z(B,H,W,`⊎`,`\\uplus`,!0),z(B,H,W,`⊓`,`\\sqcap`,!0),z(B,H,W,`∗`,`\\ast`),z(B,H,W,`⊔`,`\\sqcup`,!0),z(B,H,W,`◯`,`\\bigcirc`,!0),z(B,H,W,`∙`,`\\bullet`,!0),z(B,H,W,`‡`,`\\ddagger`),z(B,H,W,`≀`,`\\wr`,!0),z(B,H,W,`⨿`,`\\amalg`),z(B,H,W,`&`,`\\And`),z(B,H,K,`⟵`,`\\longleftarrow`,!0),z(B,H,K,`⇐`,`\\Leftarrow`,!0),z(B,H,K,`⟸`,`\\Longleftarrow`,!0),z(B,H,K,`⟶`,`\\longrightarrow`,!0),z(B,H,K,`⇒`,`\\Rightarrow`,!0),z(B,H,K,`⟹`,`\\Longrightarrow`,!0),z(B,H,K,`↔`,`\\leftrightarrow`,!0),z(B,H,K,`⟷`,`\\longleftrightarrow`,!0),z(B,H,K,`⇔`,`\\Leftrightarrow`,!0),z(B,H,K,`⟺`,`\\Longleftrightarrow`,!0),z(B,H,K,`↦`,`\\mapsto`,!0),z(B,H,K,`⟼`,`\\longmapsto`,!0),z(B,H,K,`↗`,`\\nearrow`,!0),z(B,H,K,`↩`,`\\hookleftarrow`,!0),z(B,H,K,`↪`,`\\hookrightarrow`,!0),z(B,H,K,`↘`,`\\searrow`,!0),z(B,H,K,`↼`,`\\leftharpoonup`,!0),z(B,H,K,`⇀`,`\\rightharpoonup`,!0),z(B,H,K,`↙`,`\\swarrow`,!0),z(B,H,K,`↽`,`\\leftharpoondown`,!0),z(B,H,K,`⇁`,`\\rightharpoondown`,!0),z(B,H,K,`↖`,`\\nwarrow`,!0),z(B,H,K,`⇌`,`\\rightleftharpoons`,!0),z(B,U,K,`≮`,`\\nless`,!0),z(B,U,K,``,`\\@nleqslant`),z(B,U,K,``,`\\@nleqq`),z(B,U,K,`⪇`,`\\lneq`,!0),z(B,U,K,`≨`,`\\lneqq`,!0),z(B,U,K,``,`\\@lvertneqq`),z(B,U,K,`⋦`,`\\lnsim`,!0),z(B,U,K,`⪉`,`\\lnapprox`,!0),z(B,U,K,`⊀`,`\\nprec`,!0),z(B,U,K,`⋠`,`\\npreceq`,!0),z(B,U,K,`⋨`,`\\precnsim`,!0),z(B,U,K,`⪹`,`\\precnapprox`,!0),z(B,U,K,`≁`,`\\nsim`,!0),z(B,U,K,``,`\\@nshortmid`),z(B,U,K,`∤`,`\\nmid`,!0),z(B,U,K,`⊬`,`\\nvdash`,!0),z(B,U,K,`⊭`,`\\nvDash`,!0),z(B,U,K,`⋪`,`\\ntriangleleft`),z(B,U,K,`⋬`,`\\ntrianglelefteq`,!0),z(B,U,K,`⊊`,`\\subsetneq`,!0),z(B,U,K,``,`\\@varsubsetneq`),z(B,U,K,`⫋`,`\\subsetneqq`,!0),z(B,U,K,``,`\\@varsubsetneqq`),z(B,U,K,`≯`,`\\ngtr`,!0),z(B,U,K,``,`\\@ngeqslant`),z(B,U,K,``,`\\@ngeqq`),z(B,U,K,`⪈`,`\\gneq`,!0),z(B,U,K,`≩`,`\\gneqq`,!0),z(B,U,K,``,`\\@gvertneqq`),z(B,U,K,`⋧`,`\\gnsim`,!0),z(B,U,K,`⪊`,`\\gnapprox`,!0),z(B,U,K,`⊁`,`\\nsucc`,!0),z(B,U,K,`⋡`,`\\nsucceq`,!0),z(B,U,K,`⋩`,`\\succnsim`,!0),z(B,U,K,`⪺`,`\\succnapprox`,!0),z(B,U,K,`≆`,`\\ncong`,!0),z(B,U,K,``,`\\@nshortparallel`),z(B,U,K,`∦`,`\\nparallel`,!0),z(B,U,K,`⊯`,`\\nVDash`,!0),z(B,U,K,`⋫`,`\\ntriangleright`),z(B,U,K,`⋭`,`\\ntrianglerighteq`,!0),z(B,U,K,``,`\\@nsupseteqq`),z(B,U,K,`⊋`,`\\supsetneq`,!0),z(B,U,K,``,`\\@varsupsetneq`),z(B,U,K,`⫌`,`\\supsetneqq`,!0),z(B,U,K,``,`\\@varsupsetneqq`),z(B,U,K,`⊮`,`\\nVdash`,!0),z(B,U,K,`⪵`,`\\precneqq`,!0),z(B,U,K,`⪶`,`\\succneqq`,!0),z(B,U,K,``,`\\@nsubseteqq`),z(B,U,W,`⊴`,`\\unlhd`),z(B,U,W,`⊵`,`\\unrhd`),z(B,U,K,`↚`,`\\nleftarrow`,!0),z(B,U,K,`↛`,`\\nrightarrow`,!0),z(B,U,K,`⇍`,`\\nLeftarrow`,!0),z(B,U,K,`⇏`,`\\nRightarrow`,!0),z(B,U,K,`↮`,`\\nleftrightarrow`,!0),z(B,U,K,`⇎`,`\\nLeftrightarrow`,!0),z(B,U,K,`△`,`\\vartriangle`),z(B,U,q,`ℏ`,`\\hslash`),z(B,U,q,`▽`,`\\triangledown`),z(B,U,q,`◊`,`\\lozenge`),z(B,U,q,`Ⓢ`,`\\circledS`),z(B,U,q,`®`,`\\circledR`),z(V,U,q,`®`,`\\circledR`),z(B,U,q,`∡`,`\\measuredangle`,!0),z(B,U,q,`∄`,`\\nexists`),z(B,U,q,`℧`,`\\mho`),z(B,U,q,`Ⅎ`,`\\Finv`,!0),z(B,U,q,`⅁`,`\\Game`,!0),z(B,U,q,`‵`,`\\backprime`),z(B,U,q,`▲`,`\\blacktriangle`),z(B,U,q,`▼`,`\\blacktriangledown`),z(B,U,q,`■`,`\\blacksquare`),z(B,U,q,`⧫`,`\\blacklozenge`),z(B,U,q,`★`,`\\bigstar`),z(B,U,q,`∢`,`\\sphericalangle`,!0),z(B,U,q,`∁`,`\\complement`,!0),z(B,U,q,`ð`,`\\eth`,!0),z(V,H,q,`ð`,`ð`),z(B,U,q,`╱`,`\\diagup`),z(B,U,q,`╲`,`\\diagdown`),z(B,U,q,`□`,`\\square`),z(B,U,q,`□`,`\\Box`),z(B,U,q,`◊`,`\\Diamond`),z(B,U,q,`¥`,`\\yen`,!0),z(V,U,q,`¥`,`\\yen`,!0),z(B,U,q,`✓`,`\\checkmark`,!0),z(V,U,q,`✓`,`\\checkmark`),z(B,U,q,`ℶ`,`\\beth`,!0),z(B,U,q,`ℸ`,`\\daleth`,!0),z(B,U,q,`ℷ`,`\\gimel`,!0),z(B,U,q,`ϝ`,`\\digamma`,!0),z(B,U,q,`ϰ`,`\\varkappa`),z(B,U,az,`┌`,`\\@ulcorner`,!0),z(B,U,nz,`┐`,`\\@urcorner`,!0),z(B,U,az,`└`,`\\@llcorner`,!0),z(B,U,nz,`┘`,`\\@lrcorner`,!0),z(B,U,K,`≦`,`\\leqq`,!0),z(B,U,K,`⩽`,`\\leqslant`,!0),z(B,U,K,`⪕`,`\\eqslantless`,!0),z(B,U,K,`≲`,`\\lesssim`,!0),z(B,U,K,`⪅`,`\\lessapprox`,!0),z(B,U,K,`≊`,`\\approxeq`,!0),z(B,U,W,`⋖`,`\\lessdot`),z(B,U,K,`⋘`,`\\lll`,!0),z(B,U,K,`≶`,`\\lessgtr`,!0),z(B,U,K,`⋚`,`\\lesseqgtr`,!0),z(B,U,K,`⪋`,`\\lesseqqgtr`,!0),z(B,U,K,`≑`,`\\doteqdot`),z(B,U,K,`≓`,`\\risingdotseq`,!0),z(B,U,K,`≒`,`\\fallingdotseq`,!0),z(B,U,K,`∽`,`\\backsim`,!0),z(B,U,K,`⋍`,`\\backsimeq`,!0),z(B,U,K,`⫅`,`\\subseteqq`,!0),z(B,U,K,`⋐`,`\\Subset`,!0),z(B,U,K,`⊏`,`\\sqsubset`,!0),z(B,U,K,`≼`,`\\preccurlyeq`,!0),z(B,U,K,`⋞`,`\\curlyeqprec`,!0),z(B,U,K,`≾`,`\\precsim`,!0),z(B,U,K,`⪷`,`\\precapprox`,!0),z(B,U,K,`⊲`,`\\vartriangleleft`),z(B,U,K,`⊴`,`\\trianglelefteq`),z(B,U,K,`⊨`,`\\vDash`,!0),z(B,U,K,`⊪`,`\\Vvdash`,!0),z(B,U,K,`⌣`,`\\smallsmile`),z(B,U,K,`⌢`,`\\smallfrown`),z(B,U,K,`≏`,`\\bumpeq`,!0),z(B,U,K,`≎`,`\\Bumpeq`,!0),z(B,U,K,`≧`,`\\geqq`,!0),z(B,U,K,`⩾`,`\\geqslant`,!0),z(B,U,K,`⪖`,`\\eqslantgtr`,!0),z(B,U,K,`≳`,`\\gtrsim`,!0),z(B,U,K,`⪆`,`\\gtrapprox`,!0),z(B,U,W,`⋗`,`\\gtrdot`),z(B,U,K,`⋙`,`\\ggg`,!0),z(B,U,K,`≷`,`\\gtrless`,!0),z(B,U,K,`⋛`,`\\gtreqless`,!0),z(B,U,K,`⪌`,`\\gtreqqless`,!0),z(B,U,K,`≖`,`\\eqcirc`,!0),z(B,U,K,`≗`,`\\circeq`,!0),z(B,U,K,`≜`,`\\triangleq`,!0),z(B,U,K,`∼`,`\\thicksim`),z(B,U,K,`≈`,`\\thickapprox`),z(B,U,K,`⫆`,`\\supseteqq`,!0),z(B,U,K,`⋑`,`\\Supset`,!0),z(B,U,K,`⊐`,`\\sqsupset`,!0),z(B,U,K,`≽`,`\\succcurlyeq`,!0),z(B,U,K,`⋟`,`\\curlyeqsucc`,!0),z(B,U,K,`≿`,`\\succsim`,!0),z(B,U,K,`⪸`,`\\succapprox`,!0),z(B,U,K,`⊳`,`\\vartriangleright`),z(B,U,K,`⊵`,`\\trianglerighteq`),z(B,U,K,`⊩`,`\\Vdash`,!0),z(B,U,K,`∣`,`\\shortmid`),z(B,U,K,`∥`,`\\shortparallel`),z(B,U,K,`≬`,`\\between`,!0),z(B,U,K,`⋔`,`\\pitchfork`,!0),z(B,U,K,`∝`,`\\varpropto`),z(B,U,K,`◀`,`\\blacktriangleleft`),z(B,U,K,`∴`,`\\therefore`,!0),z(B,U,K,`∍`,`\\backepsilon`),z(B,U,K,`▶`,`\\blacktriangleright`),z(B,U,K,`∵`,`\\because`,!0),z(B,U,K,`⋘`,`\\llless`),z(B,U,K,`⋙`,`\\gggtr`),z(B,U,W,`⊲`,`\\lhd`),z(B,U,W,`⊳`,`\\rhd`),z(B,U,K,`≂`,`\\eqsim`,!0),z(B,H,K,`⋈`,`\\Join`),z(B,U,K,`≑`,`\\Doteq`,!0),z(B,U,W,`∔`,`\\dotplus`,!0),z(B,U,W,`∖`,`\\smallsetminus`),z(B,U,W,`⋒`,`\\Cap`,!0),z(B,U,W,`⋓`,`\\Cup`,!0),z(B,U,W,`⩞`,`\\doublebarwedge`,!0),z(B,U,W,`⊟`,`\\boxminus`,!0),z(B,U,W,`⊞`,`\\boxplus`,!0),z(B,U,W,`⋇`,`\\divideontimes`,!0),z(B,U,W,`⋉`,`\\ltimes`,!0),z(B,U,W,`⋊`,`\\rtimes`,!0),z(B,U,W,`⋋`,`\\leftthreetimes`,!0),z(B,U,W,`⋌`,`\\rightthreetimes`,!0),z(B,U,W,`⋏`,`\\curlywedge`,!0),z(B,U,W,`⋎`,`\\curlyvee`,!0),z(B,U,W,`⊝`,`\\circleddash`,!0),z(B,U,W,`⊛`,`\\circledast`,!0),z(B,U,W,`⋅`,`\\centerdot`),z(B,U,W,`⊺`,`\\intercal`,!0),z(B,U,W,`⋒`,`\\doublecap`),z(B,U,W,`⋓`,`\\doublecup`),z(B,U,W,`⊠`,`\\boxtimes`,!0),z(B,U,K,`⇢`,`\\dashrightarrow`,!0),z(B,U,K,`⇠`,`\\dashleftarrow`,!0),z(B,U,K,`⇇`,`\\leftleftarrows`,!0),z(B,U,K,`⇆`,`\\leftrightarrows`,!0),z(B,U,K,`⇚`,`\\Lleftarrow`,!0),z(B,U,K,`↞`,`\\twoheadleftarrow`,!0),z(B,U,K,`↢`,`\\leftarrowtail`,!0),z(B,U,K,`↫`,`\\looparrowleft`,!0),z(B,U,K,`⇋`,`\\leftrightharpoons`,!0),z(B,U,K,`↶`,`\\curvearrowleft`,!0),z(B,U,K,`↺`,`\\circlearrowleft`,!0),z(B,U,K,`↰`,`\\Lsh`,!0),z(B,U,K,`⇈`,`\\upuparrows`,!0),z(B,U,K,`↿`,`\\upharpoonleft`,!0),z(B,U,K,`⇃`,`\\downharpoonleft`,!0),z(B,H,K,`⊶`,`\\origof`,!0),z(B,H,K,`⊷`,`\\imageof`,!0),z(B,U,K,`⊸`,`\\multimap`,!0),z(B,U,K,`↭`,`\\leftrightsquigarrow`,!0),z(B,U,K,`⇉`,`\\rightrightarrows`,!0),z(B,U,K,`⇄`,`\\rightleftarrows`,!0),z(B,U,K,`↠`,`\\twoheadrightarrow`,!0),z(B,U,K,`↣`,`\\rightarrowtail`,!0),z(B,U,K,`↬`,`\\looparrowright`,!0),z(B,U,K,`↷`,`\\curvearrowright`,!0),z(B,U,K,`↻`,`\\circlearrowright`,!0),z(B,U,K,`↱`,`\\Rsh`,!0),z(B,U,K,`⇊`,`\\downdownarrows`,!0),z(B,U,K,`↾`,`\\upharpoonright`,!0),z(B,U,K,`⇂`,`\\downharpoonright`,!0),z(B,U,K,`⇝`,`\\rightsquigarrow`,!0),z(B,U,K,`⇝`,`\\leadsto`),z(B,U,K,`⇛`,`\\Rrightarrow`,!0),z(B,U,K,`↾`,`\\restriction`),z(B,H,q,`‘`,"`"),z(B,H,q,`$`,`\\$`),z(V,H,q,`$`,`\\$`),z(V,H,q,`$`,`\\textdollar`),z(B,H,q,`%`,`\\%`),z(V,H,q,`%`,`\\%`),z(B,H,q,`_`,`\\_`),z(V,H,q,`_`,`\\_`),z(V,H,q,`_`,`\\textunderscore`),z(B,H,q,`∠`,`\\angle`,!0),z(B,H,q,`∞`,`\\infty`,!0),z(B,H,q,`′`,`\\prime`),z(B,H,q,`△`,`\\triangle`),z(B,H,q,`Γ`,`\\Gamma`,!0),z(B,H,q,`Δ`,`\\Delta`,!0),z(B,H,q,`Θ`,`\\Theta`,!0),z(B,H,q,`Λ`,`\\Lambda`,!0),z(B,H,q,`Ξ`,`\\Xi`,!0),z(B,H,q,`Π`,`\\Pi`,!0),z(B,H,q,`Σ`,`\\Sigma`,!0),z(B,H,q,`Υ`,`\\Upsilon`,!0),z(B,H,q,`Φ`,`\\Phi`,!0),z(B,H,q,`Ψ`,`\\Psi`,!0),z(B,H,q,`Ω`,`\\Omega`,!0),z(B,H,q,`A`,`Α`),z(B,H,q,`B`,`Β`),z(B,H,q,`E`,`Ε`),z(B,H,q,`Z`,`Ζ`),z(B,H,q,`H`,`Η`),z(B,H,q,`I`,`Ι`),z(B,H,q,`K`,`Κ`),z(B,H,q,`M`,`Μ`),z(B,H,q,`N`,`Ν`),z(B,H,q,`O`,`Ο`),z(B,H,q,`P`,`Ρ`),z(B,H,q,`T`,`Τ`),z(B,H,q,`X`,`Χ`),z(B,H,q,`¬`,`\\neg`,!0),z(B,H,q,`¬`,`\\lnot`),z(B,H,q,`⊤`,`\\top`),z(B,H,q,`⊥`,`\\bot`),z(B,H,q,`∅`,`\\emptyset`),z(B,U,q,`∅`,`\\varnothing`),z(B,H,G,`α`,`\\alpha`,!0),z(B,H,G,`β`,`\\beta`,!0),z(B,H,G,`γ`,`\\gamma`,!0),z(B,H,G,`δ`,`\\delta`,!0),z(B,H,G,`ϵ`,`\\epsilon`,!0),z(B,H,G,`ζ`,`\\zeta`,!0),z(B,H,G,`η`,`\\eta`,!0),z(B,H,G,`θ`,`\\theta`,!0),z(B,H,G,`ι`,`\\iota`,!0),z(B,H,G,`κ`,`\\kappa`,!0),z(B,H,G,`λ`,`\\lambda`,!0),z(B,H,G,`μ`,`\\mu`,!0),z(B,H,G,`ν`,`\\nu`,!0),z(B,H,G,`ξ`,`\\xi`,!0),z(B,H,G,`ο`,`\\omicron`,!0),z(B,H,G,`π`,`\\pi`,!0),z(B,H,G,`ρ`,`\\rho`,!0),z(B,H,G,`σ`,`\\sigma`,!0),z(B,H,G,`τ`,`\\tau`,!0),z(B,H,G,`υ`,`\\upsilon`,!0),z(B,H,G,`ϕ`,`\\phi`,!0),z(B,H,G,`χ`,`\\chi`,!0),z(B,H,G,`ψ`,`\\psi`,!0),z(B,H,G,`ω`,`\\omega`,!0),z(B,H,G,`ε`,`\\varepsilon`,!0),z(B,H,G,`ϑ`,`\\vartheta`,!0),z(B,H,G,`ϖ`,`\\varpi`,!0),z(B,H,G,`ϱ`,`\\varrho`,!0),z(B,H,G,`ς`,`\\varsigma`,!0),z(B,H,G,`φ`,`\\varphi`,!0),z(B,H,W,`∗`,`*`,!0),z(B,H,W,`+`,`+`),z(B,H,W,`−`,`-`,!0),z(B,H,W,`⋅`,`\\cdot`,!0),z(B,H,W,`∘`,`\\circ`,!0),z(B,H,W,`÷`,`\\div`,!0),z(B,H,W,`±`,`\\pm`,!0),z(B,H,W,`×`,`\\times`,!0),z(B,H,W,`∩`,`\\cap`,!0),z(B,H,W,`∪`,`\\cup`,!0),z(B,H,W,`∖`,`\\setminus`,!0),z(B,H,W,`∧`,`\\land`),z(B,H,W,`∨`,`\\lor`),z(B,H,W,`∧`,`\\wedge`,!0),z(B,H,W,`∨`,`\\vee`,!0),z(B,H,q,`√`,`\\surd`),z(B,H,az,`⟨`,`\\langle`,!0),z(B,H,az,`∣`,`\\lvert`),z(B,H,az,`∥`,`\\lVert`),z(B,H,nz,`?`,`?`),z(B,H,nz,`!`,`!`),z(B,H,nz,`⟩`,`\\rangle`,!0),z(B,H,nz,`∣`,`\\rvert`),z(B,H,nz,`∥`,`\\rVert`),z(B,H,K,`=`,`=`),z(B,H,K,`:`,`:`),z(B,H,K,`≈`,`\\approx`,!0),z(B,H,K,`≅`,`\\cong`,!0),z(B,H,K,`≥`,`\\ge`),z(B,H,K,`≥`,`\\geq`,!0),z(B,H,K,`←`,`\\gets`),z(B,H,K,`>`,`\\gt`,!0),z(B,H,K,`∈`,`\\in`,!0),z(B,H,K,``,`\\@not`),z(B,H,K,`⊂`,`\\subset`,!0),z(B,H,K,`⊃`,`\\supset`,!0),z(B,H,K,`⊆`,`\\subseteq`,!0),z(B,H,K,`⊇`,`\\supseteq`,!0),z(B,U,K,`⊈`,`\\nsubseteq`,!0),z(B,U,K,`⊉`,`\\nsupseteq`,!0),z(B,H,K,`⊨`,`\\models`),z(B,H,K,`←`,`\\leftarrow`,!0),z(B,H,K,`≤`,`\\le`),z(B,H,K,`≤`,`\\leq`,!0),z(B,H,K,`<`,`\\lt`,!0),z(B,H,K,`→`,`\\rightarrow`,!0),z(B,H,K,`→`,`\\to`),z(B,U,K,`≱`,`\\ngeq`,!0),z(B,U,K,`≰`,`\\nleq`,!0),z(B,H,sz,`\xA0`,`\\ `),z(B,H,sz,`\xA0`,`\\space`),z(B,H,sz,`\xA0`,`\\nobreakspace`),z(V,H,sz,`\xA0`,`\\ `),z(V,H,sz,`\xA0`,` `),z(V,H,sz,`\xA0`,`\\space`),z(V,H,sz,`\xA0`,`\\nobreakspace`),z(B,H,sz,``,`\\nobreak`),z(B,H,sz,``,`\\allowbreak`),z(B,H,oz,`,`,`,`),z(B,H,oz,`;`,`;`),z(B,U,W,`⊼`,`\\barwedge`,!0),z(B,U,W,`⊻`,`\\veebar`,!0),z(B,H,W,`⊙`,`\\odot`,!0),z(B,H,W,`⊕`,`\\oplus`,!0),z(B,H,W,`⊗`,`\\otimes`,!0),z(B,H,q,`∂`,`\\partial`,!0),z(B,H,W,`⊘`,`\\oslash`,!0),z(B,U,W,`⊚`,`\\circledcirc`,!0),z(B,U,W,`⊡`,`\\boxdot`,!0),z(B,H,W,`△`,`\\bigtriangleup`),z(B,H,W,`▽`,`\\bigtriangledown`),z(B,H,W,`†`,`\\dagger`),z(B,H,W,`⋄`,`\\diamond`),z(B,H,W,`⋆`,`\\star`),z(B,H,W,`◃`,`\\triangleleft`),z(B,H,W,`▹`,`\\triangleright`),z(B,H,az,`{`,`\\{`),z(V,H,q,`{`,`\\{`),z(V,H,q,`{`,`\\textbraceleft`),z(B,H,nz,`}`,`\\}`),z(V,H,q,`}`,`\\}`),z(V,H,q,`}`,`\\textbraceright`),z(B,H,az,`{`,`\\lbrace`),z(B,H,nz,`}`,`\\rbrace`),z(B,H,az,`[`,`\\lbrack`,!0),z(V,H,q,`[`,`\\lbrack`,!0),z(B,H,nz,`]`,`\\rbrack`,!0),z(V,H,q,`]`,`\\rbrack`,!0),z(B,H,az,`(`,`\\lparen`,!0),z(B,H,nz,`)`,`\\rparen`,!0),z(V,H,q,`<`,`\\textless`,!0),z(V,H,q,`>`,`\\textgreater`,!0),z(B,H,az,`⌊`,`\\lfloor`,!0),z(B,H,nz,`⌋`,`\\rfloor`,!0),z(B,H,az,`⌈`,`\\lceil`,!0),z(B,H,nz,`⌉`,`\\rceil`,!0),z(B,H,q,`\\`,`\\backslash`),z(B,H,q,`∣`,`|`),z(B,H,q,`∣`,`\\vert`),z(V,H,q,`|`,`\\textbar`,!0),z(B,H,q,`∥`,`\\|`),z(B,H,q,`∥`,`\\Vert`),z(V,H,q,`∥`,`\\textbardbl`),z(V,H,q,`~`,`\\textasciitilde`),z(V,H,q,`\\`,`\\textbackslash`),z(V,H,q,`^`,`\\textasciicircum`),z(B,H,K,`↑`,`\\uparrow`,!0),z(B,H,K,`⇑`,`\\Uparrow`,!0),z(B,H,K,`↓`,`\\downarrow`,!0),z(B,H,K,`⇓`,`\\Downarrow`,!0),z(B,H,K,`↕`,`\\updownarrow`,!0),z(B,H,K,`⇕`,`\\Updownarrow`,!0),z(B,H,iz,`∐`,`\\coprod`),z(B,H,iz,`⋁`,`\\bigvee`),z(B,H,iz,`⋀`,`\\bigwedge`),z(B,H,iz,`⨄`,`\\biguplus`),z(B,H,iz,`⋂`,`\\bigcap`),z(B,H,iz,`⋃`,`\\bigcup`),z(B,H,iz,`∫`,`\\int`),z(B,H,iz,`∫`,`\\intop`),z(B,H,iz,`∬`,`\\iint`),z(B,H,iz,`∭`,`\\iiint`),z(B,H,iz,`∏`,`\\prod`),z(B,H,iz,`∑`,`\\sum`),z(B,H,iz,`⨂`,`\\bigotimes`),z(B,H,iz,`⨁`,`\\bigoplus`),z(B,H,iz,`⨀`,`\\bigodot`),z(B,H,iz,`∮`,`\\oint`),z(B,H,iz,`∯`,`\\oiint`),z(B,H,iz,`∰`,`\\oiiint`),z(B,H,iz,`⨆`,`\\bigsqcup`),z(B,H,iz,`∫`,`\\smallint`),z(V,H,rz,`…`,`\\textellipsis`),z(B,H,rz,`…`,`\\mathellipsis`),z(V,H,rz,`…`,`\\ldots`,!0),z(B,H,rz,`…`,`\\ldots`,!0),z(B,H,rz,`⋯`,`\\@cdots`,!0),z(B,H,rz,`⋱`,`\\ddots`,!0),z(B,H,q,`⋮`,`\\varvdots`),z(V,H,q,`⋮`,`\\varvdots`),z(B,H,tz,`ˊ`,`\\acute`),z(B,H,tz,`ˋ`,`\\grave`),z(B,H,tz,`¨`,`\\ddot`),z(B,H,tz,`~`,`\\tilde`),z(B,H,tz,`ˉ`,`\\bar`),z(B,H,tz,`˘`,`\\breve`),z(B,H,tz,`ˇ`,`\\check`),z(B,H,tz,`^`,`\\hat`),z(B,H,tz,`⃗`,`\\vec`),z(B,H,tz,`˙`,`\\dot`),z(B,H,tz,`˚`,`\\mathring`),z(B,H,G,``,`\\@imath`),z(B,H,G,``,`\\@jmath`),z(B,H,q,`ı`,`ı`),z(B,H,q,`ȷ`,`ȷ`),z(V,H,q,`ı`,`\\i`,!0),z(V,H,q,`ȷ`,`\\j`,!0),z(V,H,q,`ß`,`\\ss`,!0),z(V,H,q,`æ`,`\\ae`,!0),z(V,H,q,`œ`,`\\oe`,!0),z(V,H,q,`ø`,`\\o`,!0),z(V,H,q,`Æ`,`\\AE`,!0),z(V,H,q,`Œ`,`\\OE`,!0),z(V,H,q,`Ø`,`\\O`,!0),z(V,H,tz,`ˊ`,`\\'`),z(V,H,tz,`ˋ`,"\\`"),z(V,H,tz,`ˆ`,`\\^`),z(V,H,tz,`˜`,`\\~`),z(V,H,tz,`ˉ`,`\\=`),z(V,H,tz,`˘`,`\\u`),z(V,H,tz,`˙`,`\\.`),z(V,H,tz,`¸`,`\\c`),z(V,H,tz,`˚`,`\\r`),z(V,H,tz,`ˇ`,`\\v`),z(V,H,tz,`¨`,`\\"`),z(V,H,tz,`˝`,`\\H`),z(V,H,tz,`◯`,`\\textcircled`);var cz={"--":!0,"---":!0,"``":!0,"''":!0};z(V,H,q,`–`,`--`,!0),z(V,H,q,`–`,`\\textendash`),z(V,H,q,`—`,`---`,!0),z(V,H,q,`—`,`\\textemdash`),z(V,H,q,`‘`,"`",!0),z(V,H,q,`‘`,`\\textquoteleft`),z(V,H,q,`’`,`'`,!0),z(V,H,q,`’`,`\\textquoteright`),z(V,H,q,`“`,"``",!0),z(V,H,q,`“`,`\\textquotedblleft`),z(V,H,q,`”`,`''`,!0),z(V,H,q,`”`,`\\textquotedblright`),z(B,H,q,`°`,`\\degree`,!0),z(V,H,q,`°`,`\\degree`),z(V,H,q,`°`,`\\textdegree`,!0),z(B,H,q,`£`,`\\pounds`),z(B,H,q,`£`,`\\mathsterling`,!0),z(V,H,q,`£`,`\\pounds`),z(V,H,q,`£`,`\\textsterling`,!0),z(B,U,q,`✠`,`\\maltese`),z(V,U,q,`✠`,`\\maltese`);for(var lz=`0123456789/@."`,uz=0;uz<lz.length;uz++){var dz=lz.charAt(uz);z(B,H,q,dz,dz)}for(var fz=`0123456789!@*()-=+";:?/.,`,pz=0;pz<fz.length;pz++){var mz=fz.charAt(pz);z(V,H,q,mz,mz)}for(var hz=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,gz=0;gz<hz.length;gz++){var _z=hz.charAt(gz);z(B,H,G,_z,_z),z(V,H,q,_z,_z)}z(B,U,q,`C`,`ℂ`),z(V,U,q,`C`,`ℂ`),z(B,U,q,`H`,`ℍ`),z(V,U,q,`H`,`ℍ`),z(B,U,q,`N`,`ℕ`),z(V,U,q,`N`,`ℕ`),z(B,U,q,`P`,`ℙ`),z(V,U,q,`P`,`ℙ`),z(B,U,q,`Q`,`ℚ`),z(V,U,q,`Q`,`ℚ`),z(B,U,q,`R`,`ℝ`),z(V,U,q,`R`,`ℝ`),z(B,U,q,`Z`,`ℤ`),z(V,U,q,`Z`,`ℤ`),z(B,H,G,`h`,`ℎ`),z(V,H,G,`h`,`ℎ`);for(var vz,yz=0;yz<hz.length;yz++){var bz=hz.charAt(yz);vz=String.fromCharCode(55349,56320+yz),z(B,H,G,bz,vz),z(V,H,q,bz,vz),vz=String.fromCharCode(55349,56372+yz),z(B,H,G,bz,vz),z(V,H,q,bz,vz),vz=String.fromCharCode(55349,56424+yz),z(B,H,G,bz,vz),z(V,H,q,bz,vz),vz=String.fromCharCode(55349,56580+yz),z(B,H,G,bz,vz),z(V,H,q,bz,vz),vz=String.fromCharCode(55349,56684+yz),z(B,H,G,bz,vz),z(V,H,q,bz,vz),vz=String.fromCharCode(55349,56736+yz),z(B,H,G,bz,vz),z(V,H,q,bz,vz),vz=String.fromCharCode(55349,56788+yz),z(B,H,G,bz,vz),z(V,H,q,bz,vz),vz=String.fromCharCode(55349,56840+yz),z(B,H,G,bz,vz),z(V,H,q,bz,vz),vz=String.fromCharCode(55349,56944+yz),z(B,H,G,bz,vz),z(V,H,q,bz,vz),yz<26&&(vz=String.fromCharCode(55349,56632+yz),z(B,H,G,bz,vz),z(V,H,q,bz,vz),vz=String.fromCharCode(55349,56476+yz),z(B,H,G,bz,vz),z(V,H,q,bz,vz))}vz=String.fromCharCode(55349,56668),z(B,H,G,`k`,vz),z(V,H,q,`k`,vz);for(var xz=0;xz<10;xz++){var Sz=xz.toString();vz=String.fromCharCode(55349,57294+xz),z(B,H,G,Sz,vz),z(V,H,q,Sz,vz),vz=String.fromCharCode(55349,57314+xz),z(B,H,G,Sz,vz),z(V,H,q,Sz,vz),vz=String.fromCharCode(55349,57324+xz),z(B,H,G,Sz,vz),z(V,H,q,Sz,vz),vz=String.fromCharCode(55349,57334+xz),z(B,H,G,Sz,vz),z(V,H,q,Sz,vz)}for(var Cz=`ÐÞþ`,wz=0;wz<Cz.length;wz++){var Tz=Cz.charAt(wz);z(B,H,G,Tz,Tz),z(V,H,q,Tz,Tz)}var Ez={mathClass:`mathbf`,textClass:`textbf`,font:`Main-Bold`},Dz={mathClass:`mathnormal`,textClass:`textit`,font:`Math-Italic`},Oz={mathClass:`boldsymbol`,textClass:`boldsymbol`,font:`Main-BoldItalic`},kz={mathClass:`mathscr`,textClass:`textscr`,font:`Script-Regular`},Az={mathClass:``,textClass:``,font:``},jz={mathClass:`mathfrak`,textClass:`textfrak`,font:`Fraktur-Regular`},Mz={mathClass:`mathbb`,textClass:`textbb`,font:`AMS-Regular`},Nz={mathClass:`mathboldfrak`,textClass:`textboldfrak`,font:`Fraktur-Regular`},Pz={mathClass:`mathsf`,textClass:`textsf`,font:`SansSerif-Regular`},Fz={mathClass:`mathboldsf`,textClass:`textboldsf`,font:`SansSerif-Bold`},Iz={mathClass:`mathitsf`,textClass:`textitsf`,font:`SansSerif-Italic`},Lz={mathClass:`mathtt`,textClass:`texttt`,font:`Typewriter-Regular`},Rz=[Ez,Ez,Dz,Dz,Oz,Oz,kz,Az,Az,Az,jz,jz,Mz,Mz,Nz,Nz,Pz,Pz,Fz,Fz,Iz,Iz,Az,Az,Lz,Lz],zz=[Ez,Az,Pz,Fz,Lz],Bz=e=>{var t=e.charCodeAt(0),n=e.charCodeAt(1),r=(t-55296)*1024+(n-56320)+65536;if(119808<=r&&r<120484)return Rz[Math.floor((r-119808)/26)];if(120782<=r&&r<=120831)return zz[Math.floor((r-120782)/10)];if(r===120485||r===120486)return Rz[0];if(120486<r&&r<120782)return Az;throw new L(`Unsupported character: `+e)},Vz=function(e,t,n){if(ez[n][e]){var r=ez[n][e].replace;r&&(e=r)}return{value:e,metrics:ZR(e,t,n)}},Hz=function(e,t,n,r,i){var a=Vz(e,t,n),o=a.metrics;e=a.value;var s;if(o){var c=o.italic;(n===`text`||r&&r.font===`mathit`)&&(c=0),s=new BR(e,o.height,o.depth,c,o.skew,o.width,i)}else typeof console<`u`&&console.warn(`No character metrics `+(`for '`+e+`' in style '`+t+`' and mode '`+n+`'`)),s=new BR(e,0,0,0,0,0,i);if(r){s.maxFontSize=r.sizeMultiplier,r.style.isTight()&&s.classes.push(`mtight`);var l=r.getColor();l&&(s.style.color=l)}return s},Uz=function(e,t,n,r){return r===void 0&&(r=[]),n.font===`boldsymbol`&&Vz(e,`Main-Bold`,t).metrics?Hz(e,`Main-Bold`,t,n,r.concat([`mathbf`])):e===`\\`||ez[t][e].font===`main`?Hz(e,`Main-Regular`,t,n,r):Hz(e,`AMS-Regular`,t,n,r.concat([`amsrm`]))},Wz=function(e,t,n){return n!==`textord`&&Vz(e,`Math-BoldItalic`,t).metrics?{fontName:`Math-BoldItalic`,fontClass:`boldsymbol`}:{fontName:`Main-Bold`,fontClass:`mathbf`}},Gz=function(e,t,n){var r=e.mode,i=e.text,a=[`mord`],{font:o,fontFamily:s,fontWeight:c,fontShape:l}=t,u=r===`math`||r===`text`&&!!o,d=u?o:s,f=``,p=``;if(i.charCodeAt(0)===55349){var m=Bz(i);f=m.font,p=m[r+`Class`]}if(f)return Hz(i,f,r,t,a.concat(p));if(d){var h,g;if(d===`boldsymbol`){var _=Wz(i,r,n);h=_.fontName,g=[_.fontClass]}else u?(h=iB[o].fontName,g=[o]):(h=rB(s,c,l),g=[s,c,l]);if(Vz(i,h,r).metrics)return Hz(i,h,r,t,a.concat(g));if(cz.hasOwnProperty(i)&&h.slice(0,10)===`Typewriter`){for(var v=[],y=0;y<i.length;y++)v.push(Hz(i[y],h,r,t,a.concat(g)));return Qz(v)}}if(n===`mathord`)return Hz(i,`Math-Italic`,r,t,a.concat([`mathnormal`]));if(n===`textord`){var b=ez[r][i]&&ez[r][i].font;if(b===`ams`)return Hz(i,rB(`amsrm`,c,l),r,t,a.concat(`amsrm`,c,l));if(b===`main`||!b)return Hz(i,rB(`textrm`,c,l),r,t,a.concat(c,l));var x=rB(b,c,l);return Hz(i,x,r,t,a.concat(x,c,l))}else throw Error(`unexpected type: `+n+` in makeOrd`)},Kz=(e,t)=>{if(AR(e.classes)!==AR(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||e.italic!==0&&e.hasClass(`mathnormal`))return!1;if(e.classes.length===1){var n=e.classes[0];if(n===`mbin`||n===`mord`)return!1}for(var r of Object.keys(e.style))if(e.style[r]!==t.style[r])return!1;for(var i of Object.keys(t.style))if(e.style[i]!==t.style[i])return!1;return!0},qz=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof BR&&r instanceof BR&&Kz(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--)}return e},Jz=function(e){for(var t=0,n=0,r=0,i=0;i<e.children.length;i++){var a=e.children[i];a.height>t&&(t=a.height),a.depth>n&&(n=a.depth),a.maxFontSize>r&&(r=a.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},J=function(e,t,n,r){var i=new IR(e,t,n,r);return Jz(i),i},Yz=(e,t,n,r)=>new IR(e,t,n,r),Xz=function(e,t,n){var r=J([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=R(r.height),r.maxFontSize=1,r},Zz=function(e,t,n,r){var i=new LR(e,t,n,r);return Jz(i),i},Qz=function(e){var t=new TR(e);return Jz(t),t},$z=function(e,t){return e instanceof TR?J([],[e],t):e},eB=function(e){if(e.positionType===`individualShift`){for(var t=e.children,n=[t[0]],r=-t[0].shift-t[0].elem.depth,i=r,a=1;a<t.length;a++){var o=-t[a].shift-i-t[a].elem.depth,s=o-(t[a-1].elem.height+t[a-1].elem.depth);i+=o,n.push({type:`kern`,size:s}),n.push(t[a])}return{children:n,depth:r}}var c;if(e.positionType===`top`){for(var l=e.positionData,u=0;u<e.children.length;u++){var d=e.children[u];l-=d.type===`kern`?d.size:d.elem.height+d.elem.depth}c=l}else if(e.positionType===`bottom`)c=-e.positionData;else{var f=e.children[0];if(f.type!==`elem`)throw Error(`First child must have type "elem".`);if(e.positionType===`shift`)c=-f.elem.depth-e.positionData;else if(e.positionType===`firstBaseline`)c=-f.elem.depth;else throw Error(`Invalid positionType `+e.positionType+`.`)}return{children:e.children,depth:c}},tB=function(e,t){for(var{children:n,depth:r}=eB(e),i=0,a=0;a<n.length;a++){var o=n[a];if(o.type===`elem`){var s=o.elem;i=Math.max(i,s.maxFontSize,s.height)}}i+=2;var c=J([`pstrut`],[]);c.style.height=R(i);for(var l=[],u=r,d=r,f=r,p=0;p<n.length;p++){var m=n[p];if(m.type===`kern`)f+=m.size;else{var h=m.elem,g=m.wrapperClasses||[],_=m.wrapperStyle||{},v=J(g,[c,h],void 0,_);v.style.top=R(-i-f-h.depth),m.marginLeft&&(v.style.marginLeft=m.marginLeft),m.marginRight&&(v.style.marginRight=m.marginRight),l.push(v),f+=h.height+h.depth}u=Math.min(u,f),d=Math.max(d,f)}var y=J([`vlist`],l);y.style.height=R(d);var b;if(u<0){var x=J([`vlist`],[J([],[])]);x.style.height=R(-u),b=[J([`vlist-r`],[y,J([`vlist-s`],[new BR(``)])]),J([`vlist-r`],[x])]}else b=[J([`vlist-r`],[y])];var S=J([`vlist-t`],b);return b.length===2&&S.classes.push(`vlist-t2`),S.height=d,S.depth=-u,S},nB=(e,t)=>{var n=J([`mspace`],[],t),r=kR(e,t);return n.style.marginRight=R(r),n},rB=(e,t,n)=>{var r,i;switch(e){case`amsrm`:r=`AMS`;break;case`textrm`:r=`Main`;break;case`textsf`:r=`SansSerif`;break;case`texttt`:r=`Typewriter`;break;default:r=e}return i=t===`textbf`&&n===`textit`?`BoldItalic`:t===`textbf`?`Bold`:n===`textit`?`Italic`:`Regular`,r+`-`+i},iB={mathbf:{variant:`bold`,fontName:`Main-Bold`},mathrm:{variant:`normal`,fontName:`Main-Regular`},textit:{variant:`italic`,fontName:`Main-Italic`},mathit:{variant:`italic`,fontName:`Main-Italic`},mathnormal:{variant:`italic`,fontName:`Math-Italic`},mathsfit:{variant:`sans-serif-italic`,fontName:`SansSerif-Italic`},mathbb:{variant:`double-struck`,fontName:`AMS-Regular`},mathcal:{variant:`script`,fontName:`Caligraphic-Regular`},mathfrak:{variant:`fraktur`,fontName:`Fraktur-Regular`},mathscr:{variant:`script`,fontName:`Script-Regular`},mathsf:{variant:`sans-serif`,fontName:`SansSerif-Regular`},mathtt:{variant:`monospace`,fontName:`Typewriter-Regular`}},aB={vec:[`vec`,.471,.714],oiintSize1:[`oiintSize1`,.957,.499],oiintSize2:[`oiintSize2`,1.472,.659],oiiintSize1:[`oiiintSize1`,1.304,.499],oiiintSize2:[`oiiintSize2`,1.98,.659]},oB=function(e,t){var[n,r,i]=aB[e],a=Yz([`overlay`],[new VR([new HR(n)],{width:R(r),height:R(i),style:`width:`+R(r),viewBox:`0 0 `+1e3*r+` `+1e3*i,preserveAspectRatio:`xMinYMin`})],t);return a.height=i,a.style.height=R(i),a.style.width=R(r),a},sB={number:3,unit:`mu`},cB={number:4,unit:`mu`},lB={number:5,unit:`mu`},uB={mord:{mop:sB,mbin:cB,mrel:lB,minner:sB},mop:{mord:sB,mop:sB,mrel:lB,minner:sB},mbin:{mord:cB,mop:cB,mopen:cB,minner:cB},mrel:{mord:lB,mop:lB,mopen:lB,minner:lB},mopen:{},mclose:{mop:sB,mbin:cB,mrel:lB,minner:sB},mpunct:{mord:sB,mop:sB,mrel:lB,mopen:sB,mclose:sB,mpunct:sB,minner:sB},minner:{mord:sB,mop:sB,mbin:cB,mrel:lB,mopen:sB,mpunct:sB,minner:sB}},dB={mord:{mop:sB},mop:{mord:sB,mop:sB},mbin:{},mrel:{},mopen:{},mclose:{mop:sB},mpunct:{},minner:{mop:sB}},fB={},pB={},mB={};function Y(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:o}=e,s={type:t,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:i},c=0;c<n.length;++c)fB[n[c]]=s;t&&(a&&(pB[t]=a),o&&(mB[t]=o))}function hB(e){var{type:t,htmlBuilder:n,mathmlBuilder:r}=e;Y({type:t,names:[],props:{numArgs:0},handler(){throw Error(`Should never be called.`)},htmlBuilder:n,mathmlBuilder:r})}var gB=function(e){return e.type===`ordgroup`&&e.body.length===1?e.body[0]:e},_B=function(e){return e.type===`ordgroup`?e.body:[e]},vB=new Set([`leftmost`,`mbin`,`mopen`,`mrel`,`mop`,`mpunct`]),yB=new Set([`rightmost`,`mrel`,`mclose`,`mpunct`]),bB={display:oR.DISPLAY,text:oR.TEXT,script:oR.SCRIPT,scriptscript:oR.SCRIPTSCRIPT},xB={mord:`mord`,mop:`mop`,mbin:`mbin`,mrel:`mrel`,mopen:`mopen`,mclose:`mclose`,mpunct:`mpunct`,minner:`minner`},SB=function(e,t,n,r){r===void 0&&(r=[null,null]);for(var i=[],a=0;a<e.length;a++){var o=OB(e[a],t);if(o instanceof TR){var s=o.children;i.push(...s)}else i.push(o)}if(qz(i),!n)return i;var c=t;if(e.length===1){var l=e[0];l.type===`sizing`?c=t.havingSize(l.size):l.type===`styling`&&(c=t.havingStyle(bB[l.style]))}var u=J([r[0]||`leftmost`],[],t),d=J([r[1]||`rightmost`],[],t),f=n===`root`;return CB(i,(e,t)=>{var n=t.classes[0],r=e.classes[0];n===`mbin`&&yB.has(r)?t.classes[0]=`mord`:r===`mbin`&&vB.has(n)&&(e.classes[0]=`mord`)},{node:u},d,f),CB(i,(e,t)=>{var n=EB(t),r=EB(e),i=n&&r?e.hasClass(`mtight`)?dB[n]?.[r]:uB[n]?.[r]:null;if(i)return nB(i,c)},{node:u},d,f),i},CB=function(e,t,n,r,i){r&&e.push(r);for(var a=0;a<e.length;a++){var o=e[a],s=wB(o);if(s){CB(s.children,t,n,null,i);continue}var c=!o.hasClass(`mspace`);if(c){var l=t(o,n.node);l&&(n.insertAfter?n.insertAfter(l):(e.unshift(l),a++))}c?n.node=o:i&&o.hasClass(`newline`)&&(n.node=J([`leftmost`])),n.insertAfter=(t=>n=>{e.splice(t+1,0,n),a++})(a)}r&&e.pop()},wB=function(e){return e instanceof TR||e instanceof LR||e instanceof IR&&e.hasClass(`enclosing`)?e:null},TB=function(e,t){var n=wB(e);if(n){var r=n.children;if(r.length){if(t===`right`)return TB(r[r.length-1],`right`);if(t===`left`)return TB(r[0],`left`)}}return e},EB=function(e,t){return e?(t&&(e=TB(e,t)),xB[e.classes[0]]||null):null},DB=function(e,t){var n=[`nulldelimiter`].concat(e.baseSizingClasses());return J(t.concat(n))},OB=function(e,t,n){if(!e)return J();if(pB[e.type]){var r=pB[e.type](e,t);if(n&&t.size!==n.size){r=J(t.sizingClasses(n),[r],t);var i=t.sizeMultiplier/n.sizeMultiplier;r.height*=i,r.depth*=i}return r}else throw new L(`Got group of unknown type: '`+e.type+`'`)};function kB(e,t){var n=J([`base`],e,t),r=J([`strut`]);return r.style.height=R(n.height+n.depth),n.depth&&(r.style.verticalAlign=R(-n.depth)),n.children.unshift(r),n}function AB(e,t){var n=null;e.length===1&&e[0].type===`tag`&&(n=e[0].tag,e=e[0].body);var r=SB(e,t,`root`),i;r.length===2&&r[1].hasClass(`tag`)&&(i=r.pop());for(var a=[],o=[],s=0;s<r.length;s++)if(o.push(r[s]),r[s].hasClass(`mbin`)||r[s].hasClass(`mrel`)||r[s].hasClass(`allowbreak`)){for(var c=!1;s<r.length-1&&r[s+1].hasClass(`mspace`)&&!r[s+1].hasClass(`newline`);)s++,o.push(r[s]),r[s].hasClass(`nobreak`)&&(c=!0);c||(a.push(kB(o,t)),o=[])}else r[s].hasClass(`newline`)&&(o.pop(),o.length>0&&(a.push(kB(o,t)),o=[]),a.push(r[s]));o.length>0&&a.push(kB(o,t));var l;n?(l=kB(SB(n,t,!0),t),l.classes=[`tag`],a.push(l)):i&&a.push(i);var u=J([`katex-html`],a);if(u.setAttribute(`aria-hidden`,`true`),l){var d=l.children[0];d.style.height=R(u.height+u.depth),u.depth&&(d.style.verticalAlign=R(-u.depth))}return u}function jB(e){return new TR(e)}var X=class{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=AR(this.classes));for(var n=0;n<this.children.length;n++)if(this.children[n]instanceof MB&&this.children[n+1]instanceof MB){for(var r=this.children[n].toText()+this.children[++n].toText();this.children[n+1]instanceof MB;)r+=this.children[++n].toText();e.appendChild(new MB(r).toNode())}else e.appendChild(this.children[n].toNode());return e}toMarkup(){var e=`<`+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=` `+t+`="`,e+=PL(this.attributes[t]),e+=`"`);this.classes.length>0&&(e+=` class ="`+PL(AR(this.classes))+`"`),e+=`>`;for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+=`</`+this.type+`>`,e}toText(){return this.children.map(e=>e.toText()).join(``)}},MB=class{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return PL(this.toText())}toText(){return this.text}},NB=class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=` `:e>=.1666&&e<=.1667?this.character=` `:e>=.2222&&e<=.2223?this.character=` `:e>=.2777&&e<=.2778?this.character=` `:e>=-.05556&&e<=-.05555?this.character=` `:e>=-.1667&&e<=-.1666?this.character=` `:e>=-.2223&&e<=-.2222?this.character=` `:e>=-.2778&&e<=-.2777?this.character=` `:this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`mspace`);return e.setAttribute(`width`,R(this.width)),e}toMarkup(){return this.character?`<mtext>`+this.character+`</mtext>`:`<mspace width="`+R(this.width)+`"/>`}toText(){return this.character?this.character:` `}},PB=new Set([`\\imath`,`\\jmath`]),FB=new Set([`mrow`,`mtable`]),IB=function(e,t,n){return ez[t][e]&&ez[t][e].replace&&e.charCodeAt(0)!==55349&&!(cz.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)===`tt`||n.font&&n.font.slice(4,6)===`tt`))&&(e=ez[t][e].replace),new MB(e)},LB=function(e){return e.length===1?e[0]:new X(`mrow`,e)},RB={mathit:`italic`,boldsymbol:e=>e.type===`textord`?`bold`:`bold-italic`,mathbf:`bold`,mathbb:`double-struck`,mathsfit:`sans-serif-italic`,mathfrak:`fraktur`,mathscr:`script`,mathcal:`script`,mathsf:`sans-serif`,mathtt:`monospace`},zB=(e,t)=>{if(e.mode===`text`){if(t.fontFamily===`texttt`)return`monospace`;if(t.fontFamily===`textsf`)return t.fontShape===`textit`&&t.fontWeight===`textbf`?`sans-serif-bold-italic`:t.fontShape===`textit`?`sans-serif-italic`:t.fontWeight===`textbf`?`bold-sans-serif`:`sans-serif`;if(t.fontShape===`textit`&&t.fontWeight===`textbf`)return`bold-italic`;if(t.fontShape===`textit`)return`italic`;if(t.fontWeight===`textbf`)return`bold`}var n=t.font;if(!n||n===`mathnormal`)return null;var r=e.mode,i=RB[n];if(i)return typeof i==`function`?i(e):i;var a=e.text;if(PB.has(a))return null;if(ez[r][a]){var o=ez[r][a].replace;o&&(a=o)}var s=iB[n].fontName;return ZR(a,s,r)?iB[n].variant:null};function BB(e){if(!e)return!1;if(e.type===`mi`&&e.children.length===1){var t=e.children[0];return t instanceof MB&&t.text===`.`}else if(e.type===`mo`&&e.children.length===1&&e.getAttribute(`separator`)===`true`&&e.getAttribute(`lspace`)===`0em`&&e.getAttribute(`rspace`)===`0em`){var n=e.children[0];return n instanceof MB&&n.text===`,`}else return!1}var VB=function(e,t,n){if(e.length===1){var r=UB(e[0],t);return n&&r instanceof X&&r.type===`mo`&&(r.setAttribute(`lspace`,`0em`),r.setAttribute(`rspace`,`0em`)),[r]}for(var i=[],a,o=0;o<e.length;o++){var s=UB(e[o],t);if(s instanceof X&&a instanceof X){if(s.type===`mtext`&&a.type===`mtext`&&s.getAttribute(`mathvariant`)===a.getAttribute(`mathvariant`)){a.children.push(...s.children);continue}else if(s.type===`mn`&&a.type===`mn`){a.children.push(...s.children);continue}else if(BB(s)&&a.type===`mn`){a.children.push(...s.children);continue}else if(s.type===`mn`&&BB(a))s.children=[...a.children,...s.children],i.pop();else if((s.type===`msup`||s.type===`msub`)&&s.children.length>=1&&(a.type===`mn`||BB(a))){var c=s.children[0];c instanceof X&&c.type===`mn`&&(c.children=[...a.children,...c.children],i.pop())}else if(a.type===`mi`&&a.children.length===1){var l=a.children[0];if(l instanceof MB&&l.text===`̸`&&(s.type===`mo`||s.type===`mi`||s.type===`mn`)){var u=s.children[0];u instanceof MB&&u.text.length>0&&(u.text=u.text.slice(0,1)+`̸`+u.text.slice(1),i.pop())}}}i.push(s),a=s}return i},HB=function(e,t,n){return LB(VB(e,t,n))},UB=function(e,t){if(!e)return new X(`mrow`);if(mB[e.type])return mB[e.type](e,t);throw new L(`Got group of unknown type: '`+e.type+`'`)};function WB(e,t,n,r,i){var a=VB(e,n),o=a.length===1&&a[0]instanceof X&&FB.has(a[0].type)?a[0]:new X(`mrow`,a),s=new X(`annotation`,[new MB(t)]);s.setAttribute(`encoding`,`application/x-tex`);var c=new X(`math`,[new X(`semantics`,[o,s])]);return c.setAttribute(`xmlns`,`http://www.w3.org/1998/Math/MathML`),r&&c.setAttribute(`display`,`block`),J([i?`katex`:`katex-mathml`],[c])}var GB=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],KB=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],qB=function(e,t){return t.size<2?e:GB[e-1][t.size-1]},JB=class e{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||e.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||``,this.fontFamily=t.fontFamily||``,this.fontWeight=t.fontWeight||``,this.fontShape=t.fontShape||``,this.sizeMultiplier=KB[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(n,t),new e(n)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:qB(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:KB[e-1]})}havingBaseStyle(t){t||=this.style.text();var n=qB(e.BASESIZE,t);return this.size===n&&this.textSize===e.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:``})}withTextFontWeight(e){return this.extend({fontWeight:e,font:``})}withTextFontShape(e){return this.extend({fontShape:e,font:``})}sizingClasses(e){return e.size===this.size?[]:[`sizing`,`reset-size`+e.size,`size`+this.size]}baseSizingClasses(){return this.size===e.BASESIZE?[]:[`sizing`,`reset-size`+this.size,`size`+e.BASESIZE]}fontMetrics(){return this._fontMetrics||=$R(this.size),this._fontMetrics}getColor(){return this.phantom?`transparent`:this.color}};JB.BASESIZE=6;var YB=function(e){return new JB({style:e.displayMode?oR.DISPLAY:oR.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},XB=function(e,t){if(t.displayMode){var n=[`katex-display`];t.leqno&&n.push(`leqno`),t.fleqn&&n.push(`fleqn`),e=J(n,[e])}return e},ZB=function(e,t,n){var r=YB(n),i;return n.output===`mathml`?WB(e,t,r,n.displayMode,!0):(i=n.output===`html`?J([`katex`],[AB(e,r)]):J([`katex`],[WB(e,t,r,n.displayMode,!1),AB(e,r)]),XB(i,n))},QB=function(e,t,n){return XB(J([`katex`],[AB(e,YB(n))]),n)},$B={widehat:`^`,widecheck:`ˇ`,widetilde:`~`,utilde:`~`,overleftarrow:`←`,underleftarrow:`←`,xleftarrow:`←`,overrightarrow:`→`,underrightarrow:`→`,xrightarrow:`→`,underbrace:`⏟`,overbrace:`⏞`,underbracket:`⎵`,overbracket:`⎴`,overgroup:`⏠`,undergroup:`⏡`,overleftrightarrow:`↔`,underleftrightarrow:`↔`,xleftrightarrow:`↔`,Overrightarrow:`⇒`,xRightarrow:`⇒`,overleftharpoon:`↼`,xleftharpoonup:`↼`,overrightharpoon:`⇀`,xrightharpoonup:`⇀`,xLeftarrow:`⇐`,xLeftrightarrow:`⇔`,xhookleftarrow:`↩`,xhookrightarrow:`↪`,xmapsto:`↦`,xrightharpoondown:`⇁`,xleftharpoondown:`↽`,xrightleftharpoons:`⇌`,xleftrightharpoons:`⇋`,xtwoheadleftarrow:`↞`,xtwoheadrightarrow:`↠`,xlongequal:`=`,xtofrom:`⇄`,xrightleftarrows:`⇄`,xrightequilibrium:`⇌`,xleftequilibrium:`⇋`,"\\cdrightarrow":`→`,"\\cdleftarrow":`←`,"\\cdlongequal":`=`},eV=function(e){var t=new X(`mo`,[new MB($B[e.replace(/^\\/,``)])]);return t.setAttribute(`stretchy`,`true`),t},tV={overrightarrow:[[`rightarrow`],.888,522,`xMaxYMin`],overleftarrow:[[`leftarrow`],.888,522,`xMinYMin`],underrightarrow:[[`rightarrow`],.888,522,`xMaxYMin`],underleftarrow:[[`leftarrow`],.888,522,`xMinYMin`],xrightarrow:[[`rightarrow`],1.469,522,`xMaxYMin`],"\\cdrightarrow":[[`rightarrow`],3,522,`xMaxYMin`],xleftarrow:[[`leftarrow`],1.469,522,`xMinYMin`],"\\cdleftarrow":[[`leftarrow`],3,522,`xMinYMin`],Overrightarrow:[[`doublerightarrow`],.888,560,`xMaxYMin`],xRightarrow:[[`doublerightarrow`],1.526,560,`xMaxYMin`],xLeftarrow:[[`doubleleftarrow`],1.526,560,`xMinYMin`],overleftharpoon:[[`leftharpoon`],.888,522,`xMinYMin`],xleftharpoonup:[[`leftharpoon`],.888,522,`xMinYMin`],xleftharpoondown:[[`leftharpoondown`],.888,522,`xMinYMin`],overrightharpoon:[[`rightharpoon`],.888,522,`xMaxYMin`],xrightharpoonup:[[`rightharpoon`],.888,522,`xMaxYMin`],xrightharpoondown:[[`rightharpoondown`],.888,522,`xMaxYMin`],xlongequal:[[`longequal`],.888,334,`xMinYMin`],"\\cdlongequal":[[`longequal`],3,334,`xMinYMin`],xtwoheadleftarrow:[[`twoheadleftarrow`],.888,334,`xMinYMin`],xtwoheadrightarrow:[[`twoheadrightarrow`],.888,334,`xMaxYMin`],overleftrightarrow:[[`leftarrow`,`rightarrow`],.888,522],overbrace:[[`leftbrace`,`midbrace`,`rightbrace`],1.6,548],underbrace:[[`leftbraceunder`,`midbraceunder`,`rightbraceunder`],1.6,548],underleftrightarrow:[[`leftarrow`,`rightarrow`],.888,522],xleftrightarrow:[[`leftarrow`,`rightarrow`],1.75,522],xLeftrightarrow:[[`doubleleftarrow`,`doublerightarrow`],1.75,560],xrightleftharpoons:[[`leftharpoondownplus`,`rightharpoonplus`],1.75,716],xleftrightharpoons:[[`leftharpoonplus`,`rightharpoondownplus`],1.75,716],xhookleftarrow:[[`leftarrow`,`righthook`],1.08,522],xhookrightarrow:[[`lefthook`,`rightarrow`],1.08,522],overlinesegment:[[`leftlinesegment`,`rightlinesegment`],.888,522],underlinesegment:[[`leftlinesegment`,`rightlinesegment`],.888,522],overbracket:[[`leftbracketover`,`rightbracketover`],1.6,440],underbracket:[[`leftbracketunder`,`rightbracketunder`],1.6,410],overgroup:[[`leftgroup`,`rightgroup`],.888,342],undergroup:[[`leftgroupunder`,`rightgroupunder`],.888,342],xmapsto:[[`leftmapsto`,`rightarrow`],1.5,522],xtofrom:[[`leftToFrom`,`rightToFrom`],1.75,528],xrightleftarrows:[[`baraboveleftarrow`,`rightarrowabovebar`],1.75,901],xrightequilibrium:[[`baraboveshortleftharpoon`,`rightharpoonaboveshortbar`],1.75,716],xleftequilibrium:[[`shortbaraboveleftharpoon`,`shortrightharpoonabovebar`],1.75,716]},nV=new Set([`widehat`,`widecheck`,`widetilde`,`utilde`]),rV=function(e,t){function n(){var n=4e5,r=e.label.slice(1);if(nV.has(r)&&`base`in e){var i=e.base.type===`ordgroup`?e.base.body.length:1,a,o,s;if(i>5)r===`widehat`||r===`widecheck`?(a=420,n=2364,s=.42,o=r+`4`):(a=312,n=2340,s=.34,o=`tilde4`);else{var c=[1,1,2,2,3,3][i];r===`widehat`||r===`widecheck`?(n=[0,1062,2364,2364,2364][c],a=[0,239,300,360,420][c],s=[0,.24,.3,.3,.36,.42][c],o=r+c):(n=[0,600,1033,2339,2340][c],a=[0,260,286,306,312][c],s=[0,.26,.286,.3,.306,.34][c],o=`tilde`+c)}return{span:Yz([],[new VR([new HR(o)],{width:`100%`,height:R(s),viewBox:`0 0 `+n+` `+a,preserveAspectRatio:`none`})],t),minWidth:0,height:s}}else{var l=[],u=tV[r];if(!u)throw Error(`No SVG data for "`+r+`".`);var[d,f,p]=u,m=p/1e3,h=d.length,g,_;if(h===1){if(u.length!==4)throw Error(`Expected 4-tuple for single-path SVG data "`+r+`".`);g=[`hide-tail`],_=[u[3]]}else if(h===2)g=[`halfarrow-left`,`halfarrow-right`],_=[`xMinYMin`,`xMaxYMin`];else if(h===3)g=[`brace-left`,`brace-center`,`brace-right`],_=[`xMinYMin`,`xMidYMin`,`xMaxYMin`];else throw Error(`Correct katexImagesData or update code here to support
|
|
348
|
+
`+h+` children.`);for(var v=0;v<h;v++){var y=new VR([new HR(d[v])],{width:`400em`,height:R(m),viewBox:`0 0 `+n+` `+p,preserveAspectRatio:_[v]+` slice`}),b=Yz([g[v]],[y],t);if(h===1)return{span:b,minWidth:f,height:m};b.style.height=R(m),l.push(b)}return{span:J([`stretchy`],l,t),minWidth:f,height:m}}}var{span:r,minWidth:i,height:a}=n();return r.height=a,r.style.height=R(a),i>0&&(r.style.minWidth=R(i)),r},iV=function(e,t,n,r,i){var a,o=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(a=J([`stretchy`,t],[],i),t===`fbox`){var s=i.color&&i.getColor();s&&(a.style.borderColor=s)}}else{var c=[];/^[bx]cancel$/.test(t)&&c.push(new UR({x1:`0`,y1:`0`,x2:`100%`,y2:`100%`,"stroke-width":`0.046em`})),/^x?cancel$/.test(t)&&c.push(new UR({x1:`0`,y1:`100%`,x2:`100%`,y2:`0`,"stroke-width":`0.046em`})),a=Yz([],[new VR(c,{width:`100%`,height:R(o)})],i)}return a.height=o,a.style.height=R(o),a},aV={bin:1,close:1,inner:1,open:1,punct:1,rel:1},oV={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function sV(e){return e in aV}function cV(e,t){if(!e||e.type!==t)throw Error(`Expected node of type `+t+`, but got `+(e?`node of type `+e.type:String(e)));return e}function lV(e){var t=uV(e);if(!t)throw Error(`Expected node of symbol group type, but got `+(e?`node of type `+e.type:String(e)));return t}function uV(e){return e&&(e.type===`atom`||oV.hasOwnProperty(e.type))?e:null}var dV=e=>{if(e instanceof BR)return e;if(KR(e)&&e.children.length===1)return dV(e.children[0])},fV=(e,t)=>{var n,r,i;e&&e.type===`supsub`?(r=cV(e.base,`accent`),n=r.base,e.base=n,i=GR(OB(e,t)),e.base=r):(r=cV(e,`accent`),n=r.base);var a=OB(n,t.havingCrampedStyle()),o=r.isShifty&&LL(n),s=0;o&&(s=dV(a)?.skew??0);var c=r.label===`\\c`,l=c?a.height+a.depth:Math.min(a.height,t.fontMetrics().xHeight),u;if(r.isStretchy)u=rV(r,t),u=tB({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`elem`,elem:u,wrapperClasses:[`svg-align`],wrapperStyle:s>0?{width:`calc(100% - `+R(2*s)+`)`,marginLeft:R(2*s)}:void 0}]});else{var d,f;r.label===`\\vec`?(d=oB(`vec`,t),f=aB.vec[1]):(d=Gz({type:`textord`,mode:r.mode,text:r.label},t,`textord`),d=WR(d),d.italic=0,f=d.width,c&&(l+=d.depth)),u=J([`accent-body`],[d]);var p=r.label===`\\textcircled`;p&&(u.classes.push(`accent-full`),l=a.height);var m=s;p||(m-=f/2),u.style.left=R(m),r.label===`\\textcircled`&&(u.style.top=`.2em`),u=tB({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:-l},{type:`elem`,elem:u}]})}var h=J([`mord`,`accent`],[u],t);return i?(i.children[0]=h,i.height=Math.max(h.height,i.height),i.classes[0]=`mord`,i):h},pV=(e,t)=>{var n=e.isStretchy?eV(e.label):new X(`mo`,[IB(e.label,e.mode)]),r=new X(`mover`,[UB(e.base,t),n]);return r.setAttribute(`accent`,`true`),r},mV=new RegExp([`\\acute`,`\\grave`,`\\ddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`].map(e=>`\\`+e).join(`|`));Y({type:`accent`,names:[`\\acute`,`\\grave`,`\\ddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`,`\\widecheck`,`\\widehat`,`\\widetilde`,`\\overrightarrow`,`\\overleftarrow`,`\\Overrightarrow`,`\\overleftrightarrow`,`\\overgroup`,`\\overlinesegment`,`\\overleftharpoon`,`\\overrightharpoon`],props:{numArgs:1},handler:(e,t)=>{var n=gB(t[0]),r=!mV.test(e.funcName),i=!r||e.funcName===`\\widehat`||e.funcName===`\\widetilde`||e.funcName===`\\widecheck`;return{type:`accent`,mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:fV,mathmlBuilder:pV}),Y({type:`accent`,names:[`\\'`,"\\`",`\\^`,`\\~`,`\\=`,`\\u`,`\\.`,`\\"`,`\\c`,`\\r`,`\\H`,`\\v`,`\\textcircled`],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`primitive`]},handler:(e,t)=>{var n=t[0],r=e.parser.mode;return r===`math`&&(e.parser.settings.reportNonstrict(`mathVsTextAccents`,`LaTeX's accent `+e.funcName+` works only in text mode`),r=`text`),{type:`accent`,mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:fV,mathmlBuilder:pV}),Y({type:`accentUnder`,names:[`\\underleftarrow`,`\\underrightarrow`,`\\underleftrightarrow`,`\\undergroup`,`\\underlinesegment`,`\\utilde`],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:`accentUnder`,mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=OB(e.base,t),r=rV(e,t),i=e.label===`\\utilde`?.12:0;return J([`mord`,`accentunder`],[tB({positionType:`top`,positionData:n.height,children:[{type:`elem`,elem:r,wrapperClasses:[`svg-align`]},{type:`kern`,size:i},{type:`elem`,elem:n}]})],t)},mathmlBuilder:(e,t)=>{var n=eV(e.label),r=new X(`munder`,[UB(e.base,t),n]);return r.setAttribute(`accentunder`,`true`),r}});var hV=e=>{var t=new X(`mpadded`,e?[e]:[]);return t.setAttribute(`width`,`+0.6em`),t.setAttribute(`lspace`,`0.3em`),t};Y({type:`xArrow`,names:[`\\xleftarrow`,`\\xrightarrow`,`\\xLeftarrow`,`\\xRightarrow`,`\\xleftrightarrow`,`\\xLeftrightarrow`,`\\xhookleftarrow`,`\\xhookrightarrow`,`\\xmapsto`,`\\xrightharpoondown`,`\\xrightharpoonup`,`\\xleftharpoondown`,`\\xleftharpoonup`,`\\xrightleftharpoons`,`\\xleftrightharpoons`,`\\xlongequal`,`\\xtwoheadrightarrow`,`\\xtwoheadleftarrow`,`\\xtofrom`,`\\xrightleftarrows`,`\\xrightequilibrium`,`\\xleftequilibrium`,`\\\\cdrightarrow`,`\\\\cdleftarrow`,`\\\\cdlongequal`],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r,funcName:i}=e;return{type:`xArrow`,mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,r=t.havingStyle(n.sup()),i=$z(OB(e.body,r,t),t),a=e.label.slice(0,2)===`\\x`?`x`:`cd`;i.classes.push(a+`-arrow-pad`);var o;e.below&&(r=t.havingStyle(n.sub()),o=$z(OB(e.below,r,t),t),o.classes.push(a+`-arrow-pad`));var s=rV(e,t),c=-t.fontMetrics().axisHeight+.5*s.height,l=-t.fontMetrics().axisHeight-.5*s.height-.111;(i.depth>.25||e.label===`\\xleftequilibrium`)&&(l-=i.depth);var u;if(o){var d=-t.fontMetrics().axisHeight+o.height+.5*s.height+.111;u=tB({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c,wrapperClasses:[`svg-align`]},{type:`elem`,elem:o,shift:d}]})}else u=tB({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c,wrapperClasses:[`svg-align`]}]});return J([`mrel`,`x-arrow`],[u],t)},mathmlBuilder(e,t){var n=eV(e.label);n.setAttribute(`minsize`,e.label.charAt(0)===`x`?`1.75em`:`3.0em`);var r;if(e.body){var i=hV(UB(e.body,t));r=e.below?new X(`munderover`,[n,hV(UB(e.below,t)),i]):new X(`mover`,[n,i])}else e.below?r=new X(`munder`,[n,hV(UB(e.below,t))]):(r=hV(),r=new X(`mover`,[n,r]));return r}});function gV(e,t){var n=SB(e.body,t,!0);return J([e.mclass],n,t)}function _V(e,t){var n,r=VB(e.body,t);return e.mclass===`minner`?n=new X(`mpadded`,r):e.mclass===`mord`?e.isCharacterBox?(n=r[0],n.type=`mi`):n=new X(`mi`,r):(e.isCharacterBox?(n=r[0],n.type=`mo`):n=new X(`mo`,r),e.mclass===`mbin`?(n.attributes.lspace=`0.22em`,n.attributes.rspace=`0.22em`):e.mclass===`mpunct`?(n.attributes.lspace=`0em`,n.attributes.rspace=`0.17em`):e.mclass===`mopen`||e.mclass===`mclose`?(n.attributes.lspace=`0em`,n.attributes.rspace=`0em`):e.mclass===`minner`&&(n.attributes.lspace=`0.0556em`,n.attributes.width=`+0.1111em`)),n}Y({type:`mclass`,names:[`\\mathord`,`\\mathbin`,`\\mathrel`,`\\mathopen`,`\\mathclose`,`\\mathpunct`,`\\mathinner`],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:`mclass`,mode:n.mode,mclass:`m`+r.slice(5),body:_B(i),isCharacterBox:LL(i)}},htmlBuilder:gV,mathmlBuilder:_V});var vV=e=>{var t=e.type===`ordgroup`&&e.body.length?e.body[0]:e;return t.type===`atom`&&(t.family===`bin`||t.family===`rel`)?`m`+t.family:`mord`};Y({type:`mclass`,names:[`\\@binrel`],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:`mclass`,mode:n.mode,mclass:vV(t[0]),body:_B(t[1]),isCharacterBox:LL(t[1])}}}),Y({type:`mclass`,names:[`\\stackrel`,`\\overset`,`\\underset`],props:{numArgs:2},handler(e,t){var{parser:n,funcName:r}=e,i=t[1],a=t[0],o=r===`\\stackrel`?`mrel`:vV(i),s={type:`op`,mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!==`\\stackrel`,body:_B(i)},c={type:`supsub`,mode:a.mode,base:s,sup:r===`\\underset`?null:a,sub:r===`\\underset`?a:null};return{type:`mclass`,mode:n.mode,mclass:o,body:[c],isCharacterBox:LL(c)}},htmlBuilder:gV,mathmlBuilder:_V}),Y({type:`pmb`,names:[`\\pmb`],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:`pmb`,mode:n.mode,mclass:vV(t[0]),body:_B(t[0])}},htmlBuilder(e,t){var n=SB(e.body,t,!0),r=J([e.mclass],n,t);return r.style.textShadow=`0.02em 0.01em 0.04px`,r},mathmlBuilder(e,t){var n=new X(`mstyle`,VB(e.body,t));return n.setAttribute(`style`,`text-shadow: 0.02em 0.01em 0.04px`),n}});var yV={">":`\\\\cdrightarrow`,"<":`\\\\cdleftarrow`,"=":`\\\\cdlongequal`,A:`\\uparrow`,V:`\\downarrow`,"|":`\\Vert`,".":`no arrow`},bV=()=>({type:`styling`,body:[],mode:`math`,style:`display`,resetFont:!0}),xV=e=>e.type===`textord`&&e.text===`@`,SV=(e,t)=>(e.type===`mathord`||e.type===`atom`)&&e.text===t;function CV(e,t,n){var r=yV[e];switch(r){case`\\\\cdrightarrow`:case`\\\\cdleftarrow`:return n.callFunction(r,[t[0]],[t[1]]);case`\\uparrow`:case`\\downarrow`:var i=n.callFunction(`\\\\cdleft`,[t[0]],[]),a={type:`atom`,text:r,mode:`math`,family:`rel`},o={type:`ordgroup`,mode:`math`,body:[i,n.callFunction(`\\Big`,[a],[]),n.callFunction(`\\\\cdright`,[t[1]],[])]};return n.callFunction(`\\\\cdparent`,[o],[]);case`\\\\cdlongequal`:return n.callFunction(`\\\\cdlongequal`,[],[]);case`\\Vert`:return n.callFunction(`\\Big`,[{type:`textord`,text:`\\Vert`,mode:`math`}],[]);default:return{type:`textord`,text:` `,mode:`math`}}}function wV(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set(`\\cr`,`\\\\\\relax`),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,`\\\\`)),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n===`&`||n===`\\\\`)e.consume();else if(n===`\\end`){t[t.length-1].length===0&&t.pop();break}else throw new L(`Expected \\\\ or \\cr or \\end`,e.nextToken)}for(var r=[],i=[r],a=0;a<t.length;a++){for(var o=t[a],s=bV(),c=0;c<o.length;c++)if(!xV(o[c]))s.body.push(o[c]);else{r.push(s),c+=1;var l=lV(o[c]).text,u=[,,];if(u[0]={type:`ordgroup`,mode:`math`,body:[]},u[1]={type:`ordgroup`,mode:`math`,body:[]},!`=|.`.includes(l))if(`<>AV`.includes(l))for(var d=0;d<2;d++){for(var f=!0,p=c+1;p<o.length;p++){if(SV(o[p],l)){f=!1,c=p;break}if(xV(o[p]))throw new L(`Missing a `+l+` character to complete a CD arrow.`,o[p]);u[d].body.push(o[p])}if(f)throw new L(`Missing a `+l+` character to complete a CD arrow.`,o[c])}else throw new L(`Expected one of "<>AV=|." after @`,o[c]);var m={type:`styling`,body:[CV(l,u,e)],mode:`math`,style:`display`,resetFont:!0};r.push(m),s=bV()}a%2==0?r.push(s):r.shift(),r=[],i.push(r)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:`array`,mode:`math`,body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:Array(i[0].length).fill({type:`align`,align:`c`,pregap:.25,postgap:.25}),colSeparationType:`CD`,hLinesBeforeRow:Array(i.length+1).fill([])}}Y({type:`cdlabel`,names:[`\\\\cdleft`,`\\\\cdright`],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:`cdlabel`,mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=$z(OB(e.label,n,t),t);return r.classes.push(`cd-label-`+e.side),r.style.bottom=R(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new X(`mrow`,[UB(e.label,t)]);return n=new X(`mpadded`,[n]),n.setAttribute(`width`,`0`),e.side===`left`&&n.setAttribute(`lspace`,`-1width`),n.setAttribute(`voffset`,`0.7em`),n=new X(`mstyle`,[n]),n.setAttribute(`displaystyle`,`false`),n.setAttribute(`scriptlevel`,`1`),n}}),Y({type:`cdlabelparent`,names:[`\\\\cdparent`],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:`cdlabelparent`,mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=$z(OB(e.fragment,t),t);return n.classes.push(`cd-vert-arrow`),n},mathmlBuilder(e,t){return new X(`mrow`,[UB(e.fragment,t)])}}),Y({type:`textord`,names:[`\\@char`],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=cV(t[0],`ordgroup`).body,i=``,a=0;a<r.length;a++){var o=cV(r[a],`textord`);i+=o.text}var s=parseInt(i),c;if(isNaN(s))throw new L(`\\@char has non-numeric argument `+i);if(s<0||s>=1114111)throw new L(`\\@char with invalid code point `+i);return s<=65535?c=String.fromCharCode(s):(s-=65536,c=String.fromCharCode((s>>10)+55296,(s&1023)+56320)),{type:`textord`,mode:n.mode,text:c}}});var TV=(e,t)=>Qz(SB(e.body,t.withColor(e.color),!1)),EV=(e,t)=>{var n=new X(`mstyle`,VB(e.body,t.withColor(e.color)));return n.setAttribute(`mathcolor`,e.color),n};Y({type:`color`,names:[`\\textcolor`],props:{numArgs:2,allowedInText:!0,argTypes:[`color`,`original`]},handler(e,t){var{parser:n}=e,r=cV(t[0],`color-token`).color,i=t[1];return{type:`color`,mode:n.mode,color:r,body:_B(i)}},htmlBuilder:TV,mathmlBuilder:EV}),Y({type:`color`,names:[`\\color`],props:{numArgs:1,allowedInText:!0,argTypes:[`color`]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,i=cV(t[0],`color-token`).color;n.gullet.macros.set(`\\current@color`,i);var a=n.parseExpression(!0,r);return{type:`color`,mode:n.mode,color:i,body:a}},htmlBuilder:TV,mathmlBuilder:EV}),Y({type:`cr`,names:[`\\\\`],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:r}=e,i=r.gullet.future().text===`[`?r.parseSizeGroup(!0):null,a=!r.settings.displayMode||!r.settings.useStrictBehavior(`newLineInDisplayMode`,`In LaTeX, \\\\ or \\newline does nothing in display mode`);return{type:`cr`,mode:r.mode,newLine:a,size:i&&cV(i,`size`).value}},htmlBuilder(e,t){var n=J([`mspace`],[],t);return e.newLine&&(n.classes.push(`newline`),e.size&&(n.style.marginTop=R(kR(e.size,t)))),n},mathmlBuilder(e,t){var n=new X(`mspace`);return e.newLine&&(n.setAttribute(`linebreak`,`newline`),e.size&&n.setAttribute(`height`,R(kR(e.size,t)))),n}});var DV={"\\global":`\\global`,"\\long":`\\\\globallong`,"\\\\globallong":`\\\\globallong`,"\\def":`\\gdef`,"\\gdef":`\\gdef`,"\\edef":`\\xdef`,"\\xdef":`\\xdef`,"\\let":`\\\\globallet`,"\\futurelet":`\\\\globalfuture`},OV=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new L(`Expected a control sequence`,e);return t},kV=e=>{var t=e.gullet.popToken();return t.text===`=`&&(t=e.gullet.popToken(),t.text===` `&&(t=e.gullet.popToken())),t},AV=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);i??=(n.noexpand=!0,{tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};Y({type:`internal`,names:[`\\global`,`\\long`,`\\\\globallong`],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(DV[r.text])return(n===`\\global`||n===`\\\\globallong`)&&(r.text=DV[r.text]),cV(t.parseFunction(),`internal`);throw new L(`Invalid token after macro prefix`,r)}}),Y({type:`internal`,names:[`\\def`,`\\gdef`,`\\edef`,`\\xdef`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new L(`Expected a control sequence`,r);for(var a=0,o,s=[[]];t.gullet.future().text!==`{`;)if(r=t.gullet.popToken(),r.text===`#`){if(t.gullet.future().text===`{`){o=t.gullet.future(),s[a].push(`{`);break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new L(`Invalid argument number "`+r.text+`"`);if(parseInt(r.text)!==a+1)throw new L(`Argument number "`+r.text+`" out of order`);a++,s.push([])}else if(r.text===`EOF`)throw new L(`Expected a macro definition`);else s[a].push(r.text);var{tokens:c}=t.gullet.consumeArg();return o&&c.unshift(o),(n===`\\edef`||n===`\\xdef`)&&(c=t.gullet.expandTokens(c),c.reverse()),t.gullet.macros.set(i,{tokens:c,numArgs:a,delimiters:s},n===DV[n]),{type:`internal`,mode:t.mode}}}),Y({type:`internal`,names:[`\\let`,`\\\\globallet`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=OV(t.gullet.popToken());return t.gullet.consumeSpaces(),AV(t,r,kV(t),n===`\\\\globallet`),{type:`internal`,mode:t.mode}}}),Y({type:`internal`,names:[`\\futurelet`,`\\\\globalfuture`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=OV(t.gullet.popToken()),i=t.gullet.popToken(),a=t.gullet.popToken();return AV(t,r,a,n===`\\\\globalfuture`),t.gullet.pushToken(a),t.gullet.pushToken(i),{type:`internal`,mode:t.mode}}});var jV=function(e,t,n){var r=ZR(ez.math[e]&&ez.math[e].replace||e,t,n);if(!r)throw Error(`Unsupported symbol `+e+` and font size `+t+`.`);return r},MV=function(e,t,n,r){var i=n.havingBaseStyle(t),a=J(r.concat(i.sizingClasses(n)),[e],n),o=i.sizeMultiplier/n.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},NV=function(e,t,n){var r=t.havingBaseStyle(n),i=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push(`delimcenter`),e.style.top=R(i),e.height-=i,e.depth+=i},PV=function(e,t,n,r,i,a){var o=MV(Hz(e,`Main-Regular`,i,r),t,r,a);return n&&NV(o,r,t),o},FV=function(e,t,n,r){return Hz(e,`Size`+t+`-Regular`,n,r)},IV=function(e,t,n,r,i,a){var o=FV(e,t,i,r),s=MV(J([`delimsizing`,`size`+t],[o],r),oR.TEXT,r,a);return n&&NV(s,r,oR.TEXT),s},LV=function(e,t,n){return{type:`elem`,elem:J([`delimsizinginner`,t===`Size1-Regular`?`delim-size1`:`delim-size4`],[J([],[Hz(e,t,n)])])}},RV=function(e,t,n){var r=qR[`Size4-Regular`][e.charCodeAt(0)]?qR[`Size4-Regular`][e.charCodeAt(0)][4]:qR[`Size1-Regular`][e.charCodeAt(0)][4],i=Yz([],[new VR([new HR(`inner`,xR(e,Math.round(1e3*t)))],{width:R(r),height:R(t),style:`width:`+R(r),viewBox:`0 0 `+1e3*r+` `+Math.round(1e3*t),preserveAspectRatio:`xMinYMin`})],n);return i.height=t,i.style.height=R(t),i.style.width=R(r),{type:`elem`,elem:i}},zV=.008,BV={type:`kern`,size:-1*zV},VV=new Set([`|`,`\\lvert`,`\\rvert`,`\\vert`]),HV=new Set([`\\|`,`\\lVert`,`\\rVert`,`\\Vert`]),UV=function(e,t,n,r,i,a){var o,s,c,l,u=``,d=0;o=c=l=e,s=null;var f=`Size1-Regular`;e===`\\uparrow`?c=l=`⏐`:e===`\\Uparrow`?c=l=`‖`:e===`\\downarrow`?o=c=`⏐`:e===`\\Downarrow`?o=c=`‖`:e===`\\updownarrow`?(o=`\\uparrow`,c=`⏐`,l=`\\downarrow`):e===`\\Updownarrow`?(o=`\\Uparrow`,c=`‖`,l=`\\Downarrow`):VV.has(e)?(c=`∣`,u=`vert`,d=333):HV.has(e)?(c=`∥`,u=`doublevert`,d=556):e===`[`||e===`\\lbrack`?(o=`⎡`,c=`⎢`,l=`⎣`,f=`Size4-Regular`,u=`lbrack`,d=667):e===`]`||e===`\\rbrack`?(o=`⎤`,c=`⎥`,l=`⎦`,f=`Size4-Regular`,u=`rbrack`,d=667):e===`\\lfloor`||e===`⌊`?(c=o=`⎢`,l=`⎣`,f=`Size4-Regular`,u=`lfloor`,d=667):e===`\\lceil`||e===`⌈`?(o=`⎡`,c=l=`⎢`,f=`Size4-Regular`,u=`lceil`,d=667):e===`\\rfloor`||e===`⌋`?(c=o=`⎥`,l=`⎦`,f=`Size4-Regular`,u=`rfloor`,d=667):e===`\\rceil`||e===`⌉`?(o=`⎤`,c=l=`⎥`,f=`Size4-Regular`,u=`rceil`,d=667):e===`(`||e===`\\lparen`?(o=`⎛`,c=`⎜`,l=`⎝`,f=`Size4-Regular`,u=`lparen`,d=875):e===`)`||e===`\\rparen`?(o=`⎞`,c=`⎟`,l=`⎠`,f=`Size4-Regular`,u=`rparen`,d=875):e===`\\{`||e===`\\lbrace`?(o=`⎧`,s=`⎨`,l=`⎩`,c=`⎪`,f=`Size4-Regular`):e===`\\}`||e===`\\rbrace`?(o=`⎫`,s=`⎬`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):e===`\\lgroup`||e===`⟮`?(o=`⎧`,l=`⎩`,c=`⎪`,f=`Size4-Regular`):e===`\\rgroup`||e===`⟯`?(o=`⎫`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):e===`\\lmoustache`||e===`⎰`?(o=`⎧`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):(e===`\\rmoustache`||e===`⎱`)&&(o=`⎫`,l=`⎩`,c=`⎪`,f=`Size4-Regular`);var p=jV(o,f,i),m=p.height+p.depth,h=jV(c,f,i),g=h.height+h.depth,_=jV(l,f,i),v=_.height+_.depth,y=0,b=1;if(s!==null){var x=jV(s,f,i);y=x.height+x.depth,b=2}var S=m+v+y,C=S+Math.max(0,Math.ceil((t-S)/(b*g)))*b*g,w=r.fontMetrics().axisHeight;n&&(w*=r.sizeMultiplier);var T=C/2-w,E=[];if(u.length>0){var D=C-m-v,ee=Math.round(C*1e3),te=CR(u,Math.round(D*1e3)),ne=new HR(u,te),re=R(d/1e3),ie=R(ee/1e3),ae=Yz([],[new VR([ne],{width:re,height:ie,viewBox:`0 0 `+d+` `+ee})],r);ae.height=ee/1e3,ae.style.width=re,ae.style.height=ie,E.push({type:`elem`,elem:ae})}else{if(E.push(LV(l,f,i)),E.push(BV),s===null){var oe=C-m-v+2*zV;E.push(RV(c,oe,r))}else{var se=(C-m-v-y)/2+2*zV;E.push(RV(c,se,r)),E.push(BV),E.push(LV(s,f,i)),E.push(BV),E.push(RV(c,se,r))}E.push(BV),E.push(LV(o,f,i))}var O=r.havingBaseStyle(oR.TEXT);return MV(J([`delimsizing`,`mult`],[tB({positionType:`bottom`,positionData:T,children:E})],O),oR.TEXT,r,a)},WV=80,GV=.08,KV=function(e,t,n,r,i){return Yz([`hide-tail`],[new VR([new HR(e,bR(e,r,n))],{width:`400em`,height:R(t),viewBox:`0 0 400000 `+n,preserveAspectRatio:`xMinYMin slice`})],i)},qV=function(e,t){var n=t.havingBaseSizing(),r=rH(`\\surd`,e*n.sizeMultiplier,tH,n),i=n.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,s,c,l,u;return r.type===`small`?(l=1e3+1e3*a+WV,e<1?i=1:e<1.4&&(i=.7),s=(1+a+GV)/i,c=(1+a)/i,o=KV(`sqrtMain`,s,l,a,t),o.style.minWidth=`0.853em`,u=.833/i):r.type===`large`?(l=(1e3+WV)*ZV[r.size],c=(ZV[r.size]+a)/i,s=(ZV[r.size]+a+GV)/i,o=KV(`sqrtSize`+r.size,s,l,a,t),o.style.minWidth=`1.02em`,u=1/i):(s=e+a+GV,c=e+a,l=Math.floor(1e3*e+a)+WV,o=KV(`sqrtTall`,s,l,a,t),o.style.minWidth=`0.742em`,u=1.056),o.height=c,o.style.height=R(s),{span:o,advanceWidth:u,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},JV=new Set([`(`,`\\lparen`,`)`,`\\rparen`,`[`,`\\lbrack`,`]`,`\\rbrack`,`\\{`,`\\lbrace`,`\\}`,`\\rbrace`,`\\lfloor`,`\\rfloor`,`⌊`,`⌋`,`\\lceil`,`\\rceil`,`⌈`,`⌉`,`\\surd`]),YV=new Set([`\\uparrow`,`\\downarrow`,`\\updownarrow`,`\\Uparrow`,`\\Downarrow`,`\\Updownarrow`,`|`,`\\|`,`\\vert`,`\\Vert`,`\\lvert`,`\\rvert`,`\\lVert`,`\\rVert`,`\\lgroup`,`\\rgroup`,`⟮`,`⟯`,`\\lmoustache`,`\\rmoustache`,`⎰`,`⎱`]),XV=new Set([`<`,`>`,`\\langle`,`\\rangle`,`/`,`\\backslash`,`\\lt`,`\\gt`]),ZV=[0,1.2,1.8,2.4,3],QV=function(e,t,n,r,i){if(e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`),JV.has(e)||XV.has(e))return IV(e,t,!1,n,r,i);if(YV.has(e))return UV(e,ZV[t],!1,n,r,i);throw new L(`Illegal delimiter: '`+e+`'`)},$V=[{type:`small`,style:oR.SCRIPTSCRIPT},{type:`small`,style:oR.SCRIPT},{type:`small`,style:oR.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4}],eH=[{type:`small`,style:oR.SCRIPTSCRIPT},{type:`small`,style:oR.SCRIPT},{type:`small`,style:oR.TEXT},{type:`stack`}],tH=[{type:`small`,style:oR.SCRIPTSCRIPT},{type:`small`,style:oR.SCRIPT},{type:`small`,style:oR.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4},{type:`stack`}],nH=function(e){if(e.type===`small`)return`Main-Regular`;if(e.type===`large`)return`Size`+e.size+`-Regular`;if(e.type===`stack`)return`Size4-Regular`;var t=e.type;throw Error(`Add support for delim type '`+t+`' here.`)},rH=function(e,t,n,r){for(var i=Math.min(2,3-r.style.size);i<n.length;i++){var a=n[i];if(a.type===`stack`)break;var o=jV(e,nH(a),`math`),s=o.height+o.depth;if(a.type===`small`){var c=r.havingBaseStyle(a.style);s*=c.sizeMultiplier}if(s>t)return a}return n[n.length-1]},iH=function(e,t,n,r,i,a){e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`);var o=XV.has(e)?$V:JV.has(e)?tH:eH,s=rH(e,t,o,r);return s.type===`small`?PV(e,s.style,n,r,i,a):s.type===`large`?IV(e,s.size,n,r,i,a):UV(e,t,n,r,i,a)},aH=function(e,t,n,r,i,a){var o=r.fontMetrics().axisHeight*r.sizeMultiplier,s=901,c=5/r.fontMetrics().ptPerEm,l=Math.max(t-o,n+o);return iH(e,Math.max(l/500*s,2*l-c),!0,r,i,a)},oH={"\\bigl":{mclass:`mopen`,size:1},"\\Bigl":{mclass:`mopen`,size:2},"\\biggl":{mclass:`mopen`,size:3},"\\Biggl":{mclass:`mopen`,size:4},"\\bigr":{mclass:`mclose`,size:1},"\\Bigr":{mclass:`mclose`,size:2},"\\biggr":{mclass:`mclose`,size:3},"\\Biggr":{mclass:`mclose`,size:4},"\\bigm":{mclass:`mrel`,size:1},"\\Bigm":{mclass:`mrel`,size:2},"\\biggm":{mclass:`mrel`,size:3},"\\Biggm":{mclass:`mrel`,size:4},"\\big":{mclass:`mord`,size:1},"\\Big":{mclass:`mord`,size:2},"\\bigg":{mclass:`mord`,size:3},"\\Bigg":{mclass:`mord`,size:4}},sH=new Set(`(,\\lparen,),\\rparen,[,\\lbrack,],\\rbrack,\\{,\\lbrace,\\},\\rbrace,\\lfloor,\\rfloor,⌊,⌋,\\lceil,\\rceil,⌈,⌉,<,>,\\langle,⟨,\\rangle,⟩,\\lt,\\gt,\\lvert,\\rvert,\\lVert,\\rVert,\\lgroup,\\rgroup,⟮,⟯,\\lmoustache,\\rmoustache,⎰,⎱,/,\\backslash,|,\\vert,\\|,\\Vert,\\uparrow,\\Uparrow,\\downarrow,\\Downarrow,\\updownarrow,\\Updownarrow,.`.split(`,`));function cH(e){return`isMiddle`in e}function lH(e,t){var n=uV(e);if(n&&sH.has(n.text))return n;throw n?new L(`Invalid delimiter '`+n.text+`' after '`+t.funcName+`'`,e):new L(`Invalid delimiter type '`+e.type+`'`,e)}Y({type:`delimsizing`,names:[`\\bigl`,`\\Bigl`,`\\biggl`,`\\Biggl`,`\\bigr`,`\\Bigr`,`\\biggr`,`\\Biggr`,`\\bigm`,`\\Bigm`,`\\biggm`,`\\Biggm`,`\\big`,`\\Big`,`\\bigg`,`\\Bigg`],props:{numArgs:1,argTypes:[`primitive`]},handler:(e,t)=>{var n=lH(t[0],e);return{type:`delimsizing`,mode:e.parser.mode,size:oH[e.funcName].size,mclass:oH[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim===`.`?J([e.mclass]):QV(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!==`.`&&t.push(IB(e.delim,e.mode));var n=new X(`mo`,t);e.mclass===`mopen`||e.mclass===`mclose`?n.setAttribute(`fence`,`true`):n.setAttribute(`fence`,`false`),n.setAttribute(`stretchy`,`true`);var r=R(ZV[e.size]);return n.setAttribute(`minsize`,r),n.setAttribute(`maxsize`,r),n}});function uH(e){if(!e.body)throw Error(`Bug: The leftright ParseNode wasn't fully parsed.`)}Y({type:`leftright-right`,names:[`\\right`],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get(`\\current@color`);if(n&&typeof n!=`string`)throw new L(`\\current@color set to non-string in \\right`);return{type:`leftright-right`,mode:e.parser.mode,delim:lH(t[0],e).text,color:n}}}),Y({type:`leftright`,names:[`\\left`],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=lH(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect(`\\right`,!1);var a=cV(r.parseFunction(),`leftright-right`);return{type:`leftright`,mode:r.mode,body:i,left:n.text,right:a.delim,rightColor:a.color}},htmlBuilder:(e,t)=>{uH(e);for(var n=SB(e.body,t,!0,[`mopen`,`mclose`]),r=0,i=0,a=!1,o=0;o<n.length;o++){var s=n[o];cH(s)?a=!0:(r=Math.max(n[o].height,r),i=Math.max(n[o].depth,i))}r*=t.sizeMultiplier,i*=t.sizeMultiplier;var c=e.left===`.`?DB(t,[`mopen`]):aH(e.left,r,i,t,e.mode,[`mopen`]);if(n.unshift(c),a)for(var l=1;l<n.length;l++){var u=n[l];if(cH(u)){var d=u.isMiddle;n[l]=aH(d.delim,r,i,d.options,e.mode,[])}}var f;if(e.right===`.`)f=DB(t,[`mclose`]);else{var p=e.rightColor?t.withColor(e.rightColor):t;f=aH(e.right,r,i,p,e.mode,[`mclose`])}return n.push(f),J([`minner`],n,t)},mathmlBuilder:(e,t)=>{uH(e);var n=VB(e.body,t);if(e.left!==`.`){var r=new X(`mo`,[IB(e.left,e.mode)]);r.setAttribute(`fence`,`true`),n.unshift(r)}if(e.right!==`.`){var i=new X(`mo`,[IB(e.right,e.mode)]);i.setAttribute(`fence`,`true`),e.rightColor&&i.setAttribute(`mathcolor`,e.rightColor),n.push(i)}return LB(n)}}),Y({type:`middle`,names:[`\\middle`],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=lH(t[0],e);if(!e.parser.leftrightDepth)throw new L(`\\middle without preceding \\left`,n);return{type:`middle`,mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim===`.`?n=DB(t,[]):(n=QV(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t}),n},mathmlBuilder:(e,t)=>{var n=new X(`mo`,[e.delim===`\\vert`||e.delim===`|`?IB(`|`,`text`):IB(e.delim,e.mode)]);return n.setAttribute(`fence`,`true`),n.setAttribute(`lspace`,`0.05em`),n.setAttribute(`rspace`,`0.05em`),n}});var dH=(e,t)=>{var n=$z(OB(e.body,t),t),r=e.label.slice(1),i=t.sizeMultiplier,a,o,s=LL(e.body);if(r===`sout`)a=J([`stretchy`,`sout`]),a.height=t.fontMetrics().defaultRuleThickness/i,o=-.5*t.fontMetrics().xHeight;else if(r===`phase`){var c=kR({number:.6,unit:`pt`},t),l=kR({number:.35,unit:`ex`},t),u=t.havingBaseSizing();i/=u.sizeMultiplier;var d=n.height+n.depth+c+l;n.style.paddingLeft=R(d/2+c);var f=Math.floor(1e3*d*i);a=Yz([`hide-tail`],[new VR([new HR(`phase`,vR(f))],{width:`400em`,height:R(f/1e3),viewBox:`0 0 400000 `+f,preserveAspectRatio:`xMinYMin slice`})],t),a.style.height=R(d),o=n.depth+c+l}else{/cancel/.test(r)?s||n.classes.push(`cancel-pad`):r===`angl`?n.classes.push(`anglpad`):n.classes.push(`boxpad`);var p,m,h=0;/box/.test(r)?(h=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),p=t.fontMetrics().fboxsep+(r===`colorbox`?0:h),m=p):r===`angl`?(h=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),p=4*h,m=Math.max(0,.25-n.depth)):(p=s?.2:0,m=p),a=iV(n,r,p,m,t),/fbox|boxed|fcolorbox/.test(r)?(a.style.borderStyle=`solid`,a.style.borderWidth=R(h)):r===`angl`&&h!==.049&&(a.style.borderTopWidth=R(h),a.style.borderRightWidth=R(h)),o=n.depth+m,e.backgroundColor&&(a.style.backgroundColor=e.backgroundColor,e.borderColor&&(a.style.borderColor=e.borderColor))}var g;if(e.backgroundColor)g=tB({positionType:`individualShift`,children:[{type:`elem`,elem:a,shift:o},{type:`elem`,elem:n,shift:0}]});else{var _=/cancel|phase/.test(r)?[`svg-align`]:[];g=tB({positionType:`individualShift`,children:[{type:`elem`,elem:n,shift:0},{type:`elem`,elem:a,shift:o,wrapperClasses:_}]})}return/cancel/.test(r)&&(g.height=n.height,g.depth=n.depth),/cancel/.test(r)&&!s?J([`mord`,`cancel-lap`],[g],t):J([`mord`],[g],t)},fH=(e,t)=>{var n,r=new X(e.label.includes(`colorbox`)?`mpadded`:`menclose`,[UB(e.body,t)]);switch(e.label){case`\\cancel`:r.setAttribute(`notation`,`updiagonalstrike`);break;case`\\bcancel`:r.setAttribute(`notation`,`downdiagonalstrike`);break;case`\\phase`:r.setAttribute(`notation`,`phasorangle`);break;case`\\sout`:r.setAttribute(`notation`,`horizontalstrike`);break;case`\\fbox`:r.setAttribute(`notation`,`box`);break;case`\\angl`:r.setAttribute(`notation`,`actuarial`);break;case`\\fcolorbox`:case`\\colorbox`:if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute(`width`,`+`+2*n+`pt`),r.setAttribute(`height`,`+`+2*n+`pt`),r.setAttribute(`lspace`,n+`pt`),r.setAttribute(`voffset`,n+`pt`),e.label===`\\fcolorbox`){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute(`style`,`border: `+R(i)+` solid `+e.borderColor)}break;case`\\xcancel`:r.setAttribute(`notation`,`updiagonalstrike downdiagonalstrike`);break}return e.backgroundColor&&r.setAttribute(`mathbackground`,e.backgroundColor),r};Y({type:`enclose`,names:[`\\colorbox`],props:{numArgs:2,allowedInText:!0,argTypes:[`color`,`hbox`]},handler(e,t,n){var{parser:r,funcName:i}=e,a=cV(t[0],`color-token`).color,o=t[1];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:a,body:o}},htmlBuilder:dH,mathmlBuilder:fH}),Y({type:`enclose`,names:[`\\fcolorbox`],props:{numArgs:3,allowedInText:!0,argTypes:[`color`,`color`,`hbox`]},handler(e,t,n){var{parser:r,funcName:i}=e,a=cV(t[0],`color-token`).color,o=cV(t[1],`color-token`).color,s=t[2];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:o,borderColor:a,body:s}},htmlBuilder:dH,mathmlBuilder:fH}),Y({type:`enclose`,names:[`\\fbox`],props:{numArgs:1,argTypes:[`hbox`],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:`enclose`,mode:n.mode,label:`\\fbox`,body:t[0]}}}),Y({type:`enclose`,names:[`\\cancel`,`\\bcancel`,`\\xcancel`,`\\phase`],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}},htmlBuilder:dH,mathmlBuilder:fH}),Y({type:`enclose`,names:[`\\sout`],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e;n.mode===`math`&&n.settings.reportNonstrict(`mathVsSout`,`LaTeX's \\sout works only in text mode`);var i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}},htmlBuilder:dH,mathmlBuilder:fH}),Y({type:`enclose`,names:[`\\angl`],props:{numArgs:1,argTypes:[`hbox`],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:`enclose`,mode:n.mode,label:`\\angl`,body:t[0]}}});var pH={};function mH(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:o}=e,s={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},c=0;c<n.length;++c)pH[n[c]]=s;a&&(pB[t]=a),o&&(mB[t]=o)}var hH={};function Z(e,t){hH[e]=t}var gH=class e{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(t,n){return n?!t||!t.loc||!n.loc||t.loc.lexer!==n.loc.lexer?null:new e(t.loc.lexer,t.loc.start,n.loc.end):t&&t.loc}},_H=class e{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(t,n){return new e(n,gH.range(this,t))}};function vH(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for(n===`\\relax`&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);n===`\\hline`||n===`\\hdashline`;)e.consume(),t.push(n===`\\hdashline`),e.consumeSpaces(),n=e.fetch().text;return t}var yH=e=>{if(!e.parser.settings.displayMode)throw new L(`{`+e.envName+`} can be used only in display mode.`)},bH=new Set([`gather`,`gather*`]);function xH(e){if(!e.includes(`ed`))return!e.includes(`*`)}function SH(e,t,n){var{hskipBeforeAndAfter:r,addJot:i,cols:a,arraystretch:o,colSeparationType:s,autoTag:c,singleRow:l,emptySingleRow:u,maxNumCols:d,leqno:f}=t;if(e.gullet.beginGroup(),l||e.gullet.macros.set(`\\cr`,`\\\\\\relax`),!o){var p=e.gullet.expandMacroAsText(`\\arraystretch`);if(p==null)o=1;else if(o=parseFloat(p),!o||o<0)throw new L(`Invalid \\arraystretch: `+p)}e.gullet.beginGroup();var m=[],h=[m],g=[],_=[],v=c==null?void 0:[];function y(){c&&e.gullet.macros.set(`\\@eqnsw`,`1`,!0)}function b(){v&&(e.gullet.macros.get(`\\df@tag`)?(v.push(e.subparse([new _H(`\\df@tag`)])),e.gullet.macros.set(`\\df@tag`,void 0,!0)):v.push(!!c&&e.gullet.macros.get(`\\@eqnsw`)===`1`))}for(y(),_.push(vH(e));;){var x=e.parseExpression(!1,l?`\\end`:`\\\\`);e.gullet.endGroup(),e.gullet.beginGroup();var S={type:`ordgroup`,mode:e.mode,body:x};n&&(S={type:`styling`,mode:e.mode,style:n,resetFont:!0,body:[S]}),m.push(S);var C=e.fetch().text;if(C===`&`){if(d&&m.length===d){if(l||s)throw new L(`Too many tab characters: &`,e.nextToken);e.settings.reportNonstrict(`textEnv`,`Too few columns specified in the {array} column argument.`)}e.consume()}else if(C===`\\end`){b(),m.length===1&&S.type===`styling`&&S.body.length===1&&S.body[0].type===`ordgroup`&&S.body[0].body.length===0&&(h.length>1||!u)&&h.pop(),_.length<h.length+1&&_.push([]);break}else if(C===`\\\\`){e.consume();var w=void 0;e.gullet.future().text!==` `&&(w=e.parseSizeGroup(!0)),g.push(w?w.value:null),b(),_.push(vH(e)),m=[],h.push(m),y()}else throw new L(`Expected & or \\\\ or \\cr or \\end`,e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:`array`,mode:e.mode,addJot:i,arraystretch:o,body:h,cols:a,rowGaps:g,hskipBeforeAndAfter:r,hLinesBeforeRow:_,colSeparationType:s,tags:v,leqno:f}}function CH(e){return e.slice(0,1)===`d`?`display`:`text`}var wH=function(e,t){var n,r,i=e.body.length,a=e.hLinesBeforeRow,o=0,s=Array(i),c=[],l=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),u=1/t.fontMetrics().ptPerEm,d=5*u;e.colSeparationType&&e.colSeparationType===`small`&&(d=.2778*(t.havingStyle(oR.SCRIPT).sizeMultiplier/t.sizeMultiplier));var f=e.colSeparationType===`CD`?kR({number:3,unit:`ex`},t):12*u,p=3*u,m=e.arraystretch*f,h=.7*m,g=.3*m,_=0;function v(e){for(var t=0;t<e.length;++t)t>0&&(_+=.25),c.push({pos:_,isDashed:e[t]})}for(v(a[0]),n=0;n<e.body.length;++n){var y=e.body[n],b=h,x=g;o<y.length&&(o=y.length);var S={cells:Array(y.length),height:0,depth:0,pos:0};for(r=0;r<y.length;++r){var C=OB(y[r],t);x<C.depth&&(x=C.depth),b<C.height&&(b=C.height),S.cells[r]=C}var w=e.rowGaps[n],T=0;w&&(T=kR(w,t),T>0&&(T+=g,x<T&&(x=T),T=0)),e.addJot&&n<e.body.length-1&&(x+=p),S.height=b,S.depth=x,_+=b,S.pos=_,_+=x+T,s[n]=S,v(a[n+1])}var E=_/2+t.fontMetrics().axisHeight,D=e.cols||[],ee=[],te,ne,re=[];if(e.tags&&e.tags.some(e=>e))for(n=0;n<i;++n){var ie=s[n],ae=ie.pos-E,oe=e.tags[n],se=void 0;se=oe===!0?J([`eqn-num`],[],t):oe===!1?J([],[],t):J([],SB(oe,t,!0),t),se.depth=ie.depth,se.height=ie.height,re.push({type:`elem`,elem:se,shift:ae})}for(r=0,ne=0;r<o||ne<D.length;++r,++ne){for(var O=D[ne],ce=!0;(le=O)?.type===`separator`;){var le;if(ce||(te=J([`arraycolsep`],[]),te.style.width=R(t.fontMetrics().doubleRuleSep),ee.push(te)),O.separator===`|`||O.separator===`:`){var ue=O.separator===`|`?`solid`:`dashed`,de=J([`vertical-separator`],[],t);de.style.height=R(_),de.style.borderRightWidth=R(l),de.style.borderRightStyle=ue,de.style.margin=`0 `+R(-l/2);var fe=_-E;fe&&(de.style.verticalAlign=R(-fe)),ee.push(de)}else throw new L(`Invalid separator type: `+O.separator);ne++,O=D[ne],ce=!1}if(!(r>=o)){var pe=void 0;(r>0||e.hskipBeforeAndAfter)&&(pe=O?.pregap??d,pe!==0&&(te=J([`arraycolsep`],[]),te.style.width=R(pe),ee.push(te)));var me=[];for(n=0;n<i;++n){var he=s[n],ge=he.cells[r];if(ge){var _e=he.pos-E;ge.depth=he.depth,ge.height=he.height,me.push({type:`elem`,elem:ge,shift:_e})}}var ve=tB({positionType:`individualShift`,children:me}),ye=J([`col-align-`+(O?.align||`c`)],[ve]);ee.push(ye),(r<o-1||e.hskipBeforeAndAfter)&&(pe=O?.postgap??d,pe!==0&&(te=J([`arraycolsep`],[]),te.style.width=R(pe),ee.push(te)))}}var be=J([`mtable`],ee);if(c.length>0){for(var xe=Xz(`hline`,t,l),Se=Xz(`hdashline`,t,l),Ce=[{type:`elem`,elem:be,shift:0}];c.length>0;){var we=c.pop(),Te=we.pos-E;we.isDashed?Ce.push({type:`elem`,elem:Se,shift:Te}):Ce.push({type:`elem`,elem:xe,shift:Te})}be=tB({positionType:`individualShift`,children:Ce})}if(re.length===0)return J([`mord`],[be],t);var Ee=J([`tag`],[tB({positionType:`individualShift`,children:re})],t);return Qz([be,Ee])},TH={c:`center `,l:`left `,r:`right `},EH=function(e,t){for(var n=[],r=new X(`mtd`,[],[`mtr-glue`]),i=new X(`mtd`,[],[`mml-eqn-num`]),a=0;a<e.body.length;a++){for(var o=e.body[a],s=[],c=0;c<o.length;c++)s.push(new X(`mtd`,[UB(o[c],t)]));e.tags&&e.tags[a]&&(s.unshift(r),s.push(r),e.leqno?s.unshift(i):s.push(i)),n.push(new X(`mtr`,s))}var l=new X(`mtable`,n),u=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);l.setAttribute(`rowspacing`,R(u));var d=``,f=``;if(e.cols&&e.cols.length>0){var p=e.cols,m=``,h=!1,g=0,_=p.length;p[0].type===`separator`&&(d+=`top `,g=1),p[p.length-1].type===`separator`&&(d+=`bottom `,--_);for(var v=g;v<_;v++){var y=p[v];y.type===`align`?(f+=TH[y.align],h&&(m+=`none `),h=!0):y.type===`separator`&&(h&&=(m+=y.separator===`|`?`solid `:`dashed `,!1))}l.setAttribute(`columnalign`,f.trim()),/[sd]/.test(m)&&l.setAttribute(`columnlines`,m.trim())}if(e.colSeparationType===`align`){for(var b=e.cols||[],x=``,S=1;S<b.length;S++)x+=S%2?`0em `:`1em `;l.setAttribute(`columnspacing`,x.trim())}else e.colSeparationType===`alignat`||e.colSeparationType===`gather`?l.setAttribute(`columnspacing`,`0em`):e.colSeparationType===`small`?l.setAttribute(`columnspacing`,`0.2778em`):e.colSeparationType===`CD`?l.setAttribute(`columnspacing`,`0.5em`):l.setAttribute(`columnspacing`,`1em`);var C=``,w=e.hLinesBeforeRow;d+=w[0].length>0?`left `:``,d+=w[w.length-1].length>0?`right `:``;for(var T=1;T<w.length-1;T++)C+=w[T].length===0?`none `:w[T][0]?`dashed `:`solid `;return/[sd]/.test(C)&&l.setAttribute(`rowlines`,C.trim()),d!==``&&(l=new X(`menclose`,[l]),l.setAttribute(`notation`,d.trim())),e.arraystretch&&e.arraystretch<1&&(l=new X(`mstyle`,[l]),l.setAttribute(`scriptlevel`,`1`)),l},DH=function(e,t){e.envName.includes(`ed`)||yH(e);var n=[],r=e.envName.includes(`at`)?`alignat`:`align`,i=e.envName===`split`,a=SH(e.parser,{cols:n,addJot:!0,autoTag:i?void 0:xH(e.envName),emptySingleRow:!0,colSeparationType:r,maxNumCols:i?2:void 0,leqno:e.parser.settings.leqno},`display`),o=0,s=0,c={type:`ordgroup`,mode:e.mode,body:[]};if(t[0]&&t[0].type===`ordgroup`){for(var l=``,u=0;u<t[0].body.length;u++){var d=cV(t[0].body[u],`textord`);l+=d.text}o=Number(l),s=o*2}var f=!s;a.body.forEach(function(e){for(var t=1;t<e.length;t+=2)cV(cV(e[t],`styling`).body[0],`ordgroup`).body.unshift(c);if(f)s<e.length&&(s=e.length);else{var n=e.length/2;if(o<n)throw new L(`Too many math in a row: `+(`expected `+o+`, but got `+n),e[0])}});for(var p=0;p<s;++p){var m=`r`,h=0;p%2==1?m=`l`:p>0&&f&&(h=1),n[p]={type:`align`,align:m,pregap:h,postgap:0}}return a.colSeparationType=f?`align`:`alignat`,a};mH({type:`array`,names:[`array`,`darray`],props:{numArgs:1},handler(e,t){var n=(uV(t[0])?[t[0]]:cV(t[0],`ordgroup`).body).map(function(e){var t=lV(e).text;if(`lcr`.includes(t))return{type:`align`,align:t};if(t===`|`)return{type:`separator`,separator:`|`};if(t===`:`)return{type:`separator`,separator:`:`};throw new L(`Unknown column alignment: `+t,e)}),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return SH(e.parser,r,CH(e.envName))},htmlBuilder:wH,mathmlBuilder:EH}),mH({type:`array`,names:[`matrix`,`pmatrix`,`bmatrix`,`Bmatrix`,`vmatrix`,`Vmatrix`,`matrix*`,`pmatrix*`,`bmatrix*`,`Bmatrix*`,`vmatrix*`,`Vmatrix*`],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:[`(`,`)`],bmatrix:[`[`,`]`],Bmatrix:[`\\{`,`\\}`],vmatrix:[`|`,`|`],Vmatrix:[`\\Vert`,`\\Vert`]}[e.envName.replace(`*`,``)],n=`c`,r={hskipBeforeAndAfter:!1,cols:[{type:`align`,align:n}]};if(e.envName.charAt(e.envName.length-1)===`*`){var i=e.parser;if(i.consumeSpaces(),i.fetch().text===`[`){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,!`lcr`.includes(n))throw new L(`Expected l or c or r`,i.nextToken);i.consume(),i.consumeSpaces(),i.expect(`]`),i.consume(),r.cols=[{type:`align`,align:n}]}}var a=SH(e.parser,r,CH(e.envName)),o=Math.max(0,...a.body.map(e=>e.length));return a.cols=Array(o).fill({type:`align`,align:n}),t?{type:`leftright`,mode:e.mode,body:[a],left:t[0],right:t[1],rightColor:void 0}:a},htmlBuilder:wH,mathmlBuilder:EH}),mH({type:`array`,names:[`smallmatrix`],props:{numArgs:0},handler(e){var t=SH(e.parser,{arraystretch:.5},`script`);return t.colSeparationType=`small`,t},htmlBuilder:wH,mathmlBuilder:EH}),mH({type:`array`,names:[`subarray`],props:{numArgs:1},handler(e,t){var n=(uV(t[0])?[t[0]]:cV(t[0],`ordgroup`).body).map(function(e){var t=lV(e).text;if(`lc`.includes(t))return{type:`align`,align:t};throw new L(`Unknown column alignment: `+t,e)});if(n.length>1)throw new L(`{subarray} can contain only one column`);var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5},i=SH(e.parser,r,`script`);if(i.body.length>0&&i.body[0].length>1)throw new L(`{subarray} can contain only one column`);return i},htmlBuilder:wH,mathmlBuilder:EH}),mH({type:`array`,names:[`cases`,`dcases`,`rcases`,`drcases`],props:{numArgs:0},handler(e){var t=SH(e.parser,{arraystretch:1.2,cols:[{type:`align`,align:`l`,pregap:0,postgap:1},{type:`align`,align:`l`,pregap:0,postgap:0}]},CH(e.envName));return{type:`leftright`,mode:e.mode,body:[t],left:e.envName.includes(`r`)?`.`:`\\{`,right:e.envName.includes(`r`)?`\\}`:`.`,rightColor:void 0}},htmlBuilder:wH,mathmlBuilder:EH}),mH({type:`array`,names:[`align`,`align*`,`aligned`,`split`],props:{numArgs:0},handler:DH,htmlBuilder:wH,mathmlBuilder:EH}),mH({type:`array`,names:[`gathered`,`gather`,`gather*`],props:{numArgs:0},handler(e){bH.has(e.envName)&&yH(e);var t={cols:[{type:`align`,align:`c`}],addJot:!0,colSeparationType:`gather`,autoTag:xH(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return SH(e.parser,t,`display`)},htmlBuilder:wH,mathmlBuilder:EH}),mH({type:`array`,names:[`alignat`,`alignat*`,`alignedat`],props:{numArgs:1},handler:DH,htmlBuilder:wH,mathmlBuilder:EH}),mH({type:`array`,names:[`equation`,`equation*`],props:{numArgs:0},handler(e){yH(e);var t={autoTag:xH(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return SH(e.parser,t,`display`)},htmlBuilder:wH,mathmlBuilder:EH}),mH({type:`array`,names:[`CD`],props:{numArgs:0},handler(e){return yH(e),wV(e.parser)},htmlBuilder:wH,mathmlBuilder:EH}),Z(`\\nonumber`,`\\gdef\\@eqnsw{0}`),Z(`\\notag`,`\\nonumber`),Y({type:`text`,names:[`\\hline`,`\\hdashline`],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new L(e.funcName+` valid only within array environment`)}});var OH=pH;Y({type:`environment`,names:[`\\begin`,`\\end`],props:{numArgs:1,argTypes:[`text`]},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];if(i.type!==`ordgroup`)throw new L(`Invalid environment name`,i);for(var a=``,o=0;o<i.body.length;++o)a+=cV(i.body[o],`textord`).text;if(r===`\\begin`){if(!OH.hasOwnProperty(a))throw new L(`No such environment: `+a,i);var s=OH[a],{args:c,optArgs:l}=n.parseArguments(`\\begin{`+a+`}`,s),u={mode:n.mode,envName:a,parser:n},d=s.handler(u,c,l);n.expect(`\\end`,!1);var f=n.nextToken,p=cV(n.parseFunction(),`environment`);if(p.name!==a)throw new L(`Mismatch: \\begin{`+a+`} matched by \\end{`+p.name+`}`,f);return d}return{type:`environment`,mode:n.mode,name:a,nameGroup:i}}});var kH=(e,t)=>{var n=e.font,r=t.withFont(n);return OB(e.body,r)},AH=(e,t)=>{var n=e.font,r=t.withFont(n);return UB(e.body,r)},jH={"\\Bbb":`\\mathbb`,"\\bold":`\\mathbf`,"\\frak":`\\mathfrak`};Y({type:`font`,names:[`\\mathrm`,`\\mathit`,`\\mathbf`,`\\mathnormal`,`\\mathsfit`,`\\mathbb`,`\\mathcal`,`\\mathfrak`,`\\mathscr`,`\\mathsf`,`\\mathtt`,`\\Bbb`,`\\bold`,`\\frak`],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=gB(t[0]),a=r;return a in jH&&(a=jH[a]),{type:`font`,mode:n.mode,font:a.slice(1),body:i}},htmlBuilder:kH,mathmlBuilder:AH}),Y({type:`mclass`,names:[`\\boldsymbol`,`\\bm`],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`mclass`,mode:n.mode,mclass:vV(r),body:[{type:`font`,mode:n.mode,font:`boldsymbol`,body:r}],isCharacterBox:LL(r)}}}),Y({type:`font`,names:[`\\rm`,`\\sf`,`\\tt`,`\\bf`,`\\it`,`\\cal`],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:i}=e,{mode:a}=n,o=n.parseExpression(!0,i);return{type:`font`,mode:a,font:`math`+r.slice(1),body:{type:`ordgroup`,mode:n.mode,body:o}}},htmlBuilder:kH,mathmlBuilder:AH});var MH=(e,t)=>{var n=t.style,r=n.fracNum(),i=n.fracDen(),a=t.havingStyle(r),o=OB(e.numer,a,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,c=3.5/t.fontMetrics().ptPerEm;o.height=o.height<s?s:o.height,o.depth=o.depth<c?c:o.depth}a=t.havingStyle(i);var l=OB(e.denom,a,t),u,d,f;e.hasBarLine?(e.barSize?(d=kR(e.barSize,t),u=Xz(`frac-line`,t,d)):u=Xz(`frac-line`,t),d=u.height,f=u.height):(u=null,d=0,f=t.fontMetrics().defaultRuleThickness);var p,m,h;n.size===oR.DISPLAY.size?(p=t.fontMetrics().num1,m=d>0?3*f:7*f,h=t.fontMetrics().denom1):(d>0?(p=t.fontMetrics().num2,m=f):(p=t.fontMetrics().num3,m=3*f),h=t.fontMetrics().denom2);var g;if(u){var _=t.fontMetrics().axisHeight;p-o.depth-(_+.5*d)<m&&(p+=m-(p-o.depth-(_+.5*d))),_-.5*d-(l.height-h)<m&&(h+=m-(_-.5*d-(l.height-h)));var v=-(_-.5*d);g=tB({positionType:`individualShift`,children:[{type:`elem`,elem:l,shift:h},{type:`elem`,elem:u,shift:v},{type:`elem`,elem:o,shift:-p}]})}else{var y=p-o.depth-(l.height-h);y<m&&(p+=.5*(m-y),h+=.5*(m-y)),g=tB({positionType:`individualShift`,children:[{type:`elem`,elem:l,shift:h},{type:`elem`,elem:o,shift:-p}]})}a=t.havingStyle(n),g.height*=a.sizeMultiplier/t.sizeMultiplier,g.depth*=a.sizeMultiplier/t.sizeMultiplier;var b=n.size===oR.DISPLAY.size?t.fontMetrics().delim1:n.size===oR.SCRIPTSCRIPT.size?t.havingStyle(oR.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,x=e.leftDelim==null?DB(t,[`mopen`]):iH(e.leftDelim,b,!0,t.havingStyle(n),e.mode,[`mopen`]),S=e.continued?J([]):e.rightDelim==null?DB(t,[`mclose`]):iH(e.rightDelim,b,!0,t.havingStyle(n),e.mode,[`mclose`]);return J([`mord`].concat(a.sizingClasses(t)),[x,J([`mfrac`],[g]),S],t)},NH=(e,t)=>{var n=new X(`mfrac`,[UB(e.numer,t),UB(e.denom,t)]);if(!e.hasBarLine)n.setAttribute(`linethickness`,`0px`);else if(e.barSize){var r=kR(e.barSize,t);n.setAttribute(`linethickness`,R(r))}if(e.leftDelim!=null||e.rightDelim!=null){var i=[];if(e.leftDelim!=null){var a=new X(`mo`,[new MB(e.leftDelim.replace(`\\`,``))]);a.setAttribute(`fence`,`true`),i.push(a)}if(i.push(n),e.rightDelim!=null){var o=new X(`mo`,[new MB(e.rightDelim.replace(`\\`,``))]);o.setAttribute(`fence`,`true`),i.push(o)}return LB(i)}return n},PH=(e,t)=>t?{type:`styling`,mode:e.mode,style:t,body:[e]}:e;Y({type:`genfrac`,names:[`\\cfrac`,`\\dfrac`,`\\frac`,`\\tfrac`,`\\dbinom`,`\\binom`,`\\tbinom`,`\\\\atopfrac`,`\\\\bracefrac`,`\\\\brackfrac`],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=t[1],o,s=null,c=null;switch(r){case`\\cfrac`:case`\\dfrac`:case`\\frac`:case`\\tfrac`:o=!0;break;case`\\\\atopfrac`:o=!1;break;case`\\dbinom`:case`\\binom`:case`\\tbinom`:o=!1,s=`(`,c=`)`;break;case`\\\\bracefrac`:o=!1,s=`\\{`,c=`\\}`;break;case`\\\\brackfrac`:o=!1,s=`[`,c=`]`;break;default:throw Error(`Unrecognized genfrac command`)}var l=r===`\\cfrac`,u=null;return l||r.startsWith(`\\d`)?u=`display`:r.startsWith(`\\t`)&&(u=`text`),PH({type:`genfrac`,mode:n.mode,numer:i,denom:a,continued:l,hasBarLine:o,leftDelim:s,rightDelim:c,barSize:null},u)},htmlBuilder:MH,mathmlBuilder:NH}),Y({type:`infix`,names:[`\\over`,`\\choose`,`\\atop`,`\\brace`,`\\brack`],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:n,token:r}=e,i;switch(n){case`\\over`:i=`\\frac`;break;case`\\choose`:i=`\\binom`;break;case`\\atop`:i=`\\\\atopfrac`;break;case`\\brace`:i=`\\\\bracefrac`;break;case`\\brack`:i=`\\\\brackfrac`;break;default:throw Error(`Unrecognized infix genfrac command`)}return{type:`infix`,mode:t.mode,replaceWith:i,token:r}}});var FH=[`display`,`text`,`script`,`scriptscript`],IH=function(e){var t=null;return e.length>0&&(t=e,t=t===`.`?null:t),t};Y({type:`genfrac`,names:[`\\genfrac`],props:{numArgs:6,allowedInArgument:!0,argTypes:[`math`,`math`,`size`,`text`,`math`,`math`]},handler(e,t){var{parser:n}=e,r=t[4],i=t[5],a=gB(t[0]),o=a.type===`atom`&&a.family===`open`?IH(a.text):null,s=gB(t[1]),c=s.type===`atom`&&s.family===`close`?IH(s.text):null,l=cV(t[2],`size`),u,d=null;l.isBlank?u=!0:(d=l.value,u=d.number>0);var f=null,p=t[3];if(p.type===`ordgroup`){if(p.body.length>0){var m=cV(p.body[0],`textord`);f=FH[Number(m.text)]}}else p=cV(p,`textord`),f=FH[Number(p.text)];return PH({type:`genfrac`,mode:n.mode,numer:r,denom:i,continued:!1,hasBarLine:u,barSize:d,leftDelim:o,rightDelim:c},f)}}),Y({type:`infix`,names:[`\\above`],props:{numArgs:1,argTypes:[`size`],infix:!0},handler(e,t){var{parser:n,funcName:r,token:i}=e;return{type:`infix`,mode:n.mode,replaceWith:`\\\\abovefrac`,size:cV(t[0],`size`).value,token:i}}}),Y({type:`genfrac`,names:[`\\\\abovefrac`],props:{numArgs:3,argTypes:[`math`,`size`,`math`]},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=cV(t[1],`infix`).size;if(!a)throw Error(`\\\\abovefrac expected size, but got `+String(a));var o=t[2],s=a.number>0;return{type:`genfrac`,mode:n.mode,numer:i,denom:o,continued:!1,hasBarLine:s,barSize:a,leftDelim:null,rightDelim:null}}});var LH=(e,t)=>{var n=t.style,r,i;e.type===`supsub`?(r=e.sup?OB(e.sup,t.havingStyle(n.sup()),t):OB(e.sub,t.havingStyle(n.sub()),t),i=cV(e.base,`horizBrace`)):i=cV(e,`horizBrace`);var a=OB(i.base,t.havingBaseStyle(oR.DISPLAY)),o=rV(i,t),s=i.isOver?tB({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:.1},{type:`elem`,elem:o,wrapperClasses:[`svg-align`]}]}):tB({positionType:`bottom`,positionData:a.depth+.1+o.height,children:[{type:`elem`,elem:o,wrapperClasses:[`svg-align`]},{type:`kern`,size:.1},{type:`elem`,elem:a}]});if(r){var c=J([`minner`,i.isOver?`mover`:`munder`],[s],t);s=i.isOver?tB({positionType:`firstBaseline`,children:[{type:`elem`,elem:c},{type:`kern`,size:.2},{type:`elem`,elem:r}]}):tB({positionType:`bottom`,positionData:c.depth+.2+r.height+r.depth,children:[{type:`elem`,elem:r},{type:`kern`,size:.2},{type:`elem`,elem:c}]})}return J([`minner`,i.isOver?`mover`:`munder`],[s],t)};Y({type:`horizBrace`,names:[`\\overbrace`,`\\underbrace`,`\\overbracket`,`\\underbracket`],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:`horizBrace`,mode:n.mode,label:r,isOver:r.includes(`\\over`),base:t[0]}},htmlBuilder:LH,mathmlBuilder:(e,t)=>{var n=eV(e.label);return new X(e.isOver?`mover`:`munder`,[UB(e.base,t),n])}}),Y({type:`href`,names:[`\\href`],props:{numArgs:2,argTypes:[`url`,`original`],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],i=cV(t[0],`url`).url;return n.settings.isTrusted({command:`\\href`,url:i})?{type:`href`,mode:n.mode,href:i,body:_B(r)}:n.formatUnsupportedCmd(`\\href`)},htmlBuilder:(e,t)=>{var n=SB(e.body,t,!1);return Zz(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=HB(e.body,t);return n instanceof X||(n=new X(`mrow`,[n])),n.setAttribute(`href`,e.href),n}}),Y({type:`href`,names:[`\\url`],props:{numArgs:1,argTypes:[`url`],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=cV(t[0],`url`).url;if(!n.settings.isTrusted({command:`\\url`,url:r}))return n.formatUnsupportedCmd(`\\url`);for(var i=[],a=0;a<r.length;a++){var o=r[a];o===`~`&&(o=`\\textasciitilde`),i.push({type:`textord`,mode:`text`,text:o})}var s={type:`text`,mode:n.mode,font:`\\texttt`,body:i};return{type:`href`,mode:n.mode,href:r,body:_B(s)}}}),Y({type:`hbox`,names:[`\\hbox`],props:{numArgs:1,argTypes:[`text`],allowedInText:!0,primitive:!0},handler(e,t){var{parser:n}=e;return{type:`hbox`,mode:n.mode,body:_B(t[0])}},htmlBuilder(e,t){return Qz(SB(e.body,t.withFont(``),!1))},mathmlBuilder(e,t){return new X(`mrow`,VB(e.body,t.withFont(``)))}}),Y({type:`html`,names:[`\\htmlClass`,`\\htmlId`,`\\htmlStyle`,`\\htmlData`],props:{numArgs:2,argTypes:[`raw`,`original`],allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,token:i}=e,a=cV(t[0],`raw`).string,o=t[1];n.settings.strict&&n.settings.reportNonstrict(`htmlExtension`,`HTML extension is disabled on strict mode`);var s,c={};switch(r){case`\\htmlClass`:c.class=a,s={command:`\\htmlClass`,class:a};break;case`\\htmlId`:c.id=a,s={command:`\\htmlId`,id:a};break;case`\\htmlStyle`:c.style=a,s={command:`\\htmlStyle`,style:a};break;case`\\htmlData`:for(var l=a.split(`,`),u=0;u<l.length;u++){var d=l[u],f=d.indexOf(`=`);if(f<0)throw new L(`\\htmlData key/value '`+d+`' missing equals sign`);var p=d.slice(0,f),m=d.slice(f+1);c[`data-`+p.trim()]=m}s={command:`\\htmlData`,attributes:c};break;default:throw Error(`Unrecognized html command`)}return n.settings.isTrusted(s)?{type:`html`,mode:n.mode,attributes:c,body:_B(o)}:n.formatUnsupportedCmd(r)},htmlBuilder:(e,t)=>{var n=SB(e.body,t,!1),r=[`enclosing`];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=J(r,n,t);for(var a in e.attributes)a!==`class`&&e.attributes.hasOwnProperty(a)&&i.setAttribute(a,e.attributes[a]);return i},mathmlBuilder:(e,t)=>HB(e.body,t)}),Y({type:`htmlmathml`,names:[`\\html@mathml`],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:`htmlmathml`,mode:n.mode,html:_B(t[0]),mathml:_B(t[1])}},htmlBuilder:(e,t)=>Qz(SB(e.html,t,!1)),mathmlBuilder:(e,t)=>HB(e.mathml,t)});var RH=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:`bp`};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new L(`Invalid size: '`+e+`' in \\includegraphics`);var n={number:+(t[1]+t[2]),unit:t[3]};if(!OR(n))throw new L(`Invalid unit: '`+n.unit+`' in \\includegraphics.`);return n};Y({type:`includegraphics`,names:[`\\includegraphics`],props:{numArgs:1,numOptionalArgs:1,argTypes:[`raw`,`url`],allowedInText:!1},handler:(e,t,n)=>{var{parser:r}=e,i={number:0,unit:`em`},a={number:.9,unit:`em`},o={number:0,unit:`em`},s=``;if(n[0])for(var c=cV(n[0],`raw`).string.split(`,`),l=0;l<c.length;l++){var u=c[l].split(`=`);if(u.length===2){var d=u[1].trim();switch(u[0].trim()){case`alt`:s=d;break;case`width`:i=RH(d);break;case`height`:a=RH(d);break;case`totalheight`:o=RH(d);break;default:throw new L(`Invalid key: '`+u[0]+`' in \\includegraphics.`)}}}var f=cV(t[0],`url`).url;return s===``&&(s=f,s=s.replace(/^.*[\\/]/,``),s=s.substring(0,s.lastIndexOf(`.`))),r.settings.isTrusted({command:`\\includegraphics`,url:f})?{type:`includegraphics`,mode:r.mode,alt:s,width:i,height:a,totalheight:o,src:f}:r.formatUnsupportedCmd(`\\includegraphics`)},htmlBuilder:(e,t)=>{var n=kR(e.height,t),r=0;e.totalheight.number>0&&(r=kR(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=kR(e.width,t));var a={height:R(n+r)};i>0&&(a.width=R(i)),r>0&&(a.verticalAlign=R(-r));var o=new RR(e.src,e.alt,a);return o.height=n,o.depth=r,o},mathmlBuilder:(e,t)=>{var n=new X(`mglyph`,[]);n.setAttribute(`alt`,e.alt);var r=kR(e.height,t),i=0;if(e.totalheight.number>0&&(i=kR(e.totalheight,t)-r,n.setAttribute(`valign`,R(-i))),n.setAttribute(`height`,R(r+i)),e.width.number>0){var a=kR(e.width,t);n.setAttribute(`width`,R(a))}return n.setAttribute(`src`,e.src),n}}),Y({type:`kern`,names:[`\\kern`,`\\mkern`,`\\hskip`,`\\mskip`],props:{numArgs:1,argTypes:[`size`],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=cV(t[0],`size`);if(n.settings.strict){var a=r[1]===`m`,o=i.value.unit===`mu`;a?(o||n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` supports only mu units, `+(`not `+i.value.unit+` units`)),n.mode!==`math`&&n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` works only in math mode`)):o&&n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` doesn't support mu units`)}return{type:`kern`,mode:n.mode,dimension:i.value}},htmlBuilder(e,t){return nB(e.dimension,t)},mathmlBuilder(e,t){return new NB(kR(e.dimension,t))}}),Y({type:`lap`,names:[`\\mathllap`,`\\mathrlap`,`\\mathclap`],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:`lap`,mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;e.alignment===`clap`?(n=J([],[OB(e.body,t)]),n=J([`inner`],[n],t)):n=J([`inner`],[OB(e.body,t)]);var r=J([`fix`],[]),i=J([e.alignment],[n,r],t),a=J([`strut`]);return a.style.height=R(i.height+i.depth),i.depth&&(a.style.verticalAlign=R(-i.depth)),i.children.unshift(a),i=J([`thinbox`],[i],t),J([`mord`,`vbox`],[i],t)},mathmlBuilder:(e,t)=>{var n=new X(`mpadded`,[UB(e.body,t)]);if(e.alignment!==`rlap`){var r=e.alignment===`llap`?`-1`:`-0.5`;n.setAttribute(`lspace`,r+`width`)}return n.setAttribute(`width`,`0px`),n}}),Y({type:`styling`,names:[`\\(`,`$`],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,i=r.mode;r.switchMode(`math`);var a=n===`\\(`?`\\)`:`$`,o=r.parseExpression(!1,a);return r.expect(a),r.switchMode(i),{type:`styling`,mode:r.mode,style:`text`,resetFont:!0,body:o}}}),Y({type:`text`,names:[`\\)`,`\\]`],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new L(`Mismatched `+e.funcName)}});var zH=(e,t)=>{switch(t.style.size){case oR.DISPLAY.size:return e.display;case oR.TEXT.size:return e.text;case oR.SCRIPT.size:return e.script;case oR.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Y({type:`mathchoice`,names:[`\\mathchoice`],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:`mathchoice`,mode:n.mode,display:_B(t[0]),text:_B(t[1]),script:_B(t[2]),scriptscript:_B(t[3])}},htmlBuilder:(e,t)=>Qz(SB(zH(e,t),t,!1)),mathmlBuilder:(e,t)=>HB(zH(e,t),t)});var BH=(e,t,n,r,i,a,o)=>{e=J([],[e]);var s=n&&LL(n),c,l;if(t){var u=OB(t,r.havingStyle(i.sup()),r);l={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var d=OB(n,r.havingStyle(i.sub()),r);c={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}var f;if(l&&c)f=tB({positionType:`bottom`,positionData:r.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+e.depth+o,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:R(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:R(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]});else if(c)f=tB({positionType:`top`,positionData:e.height-o,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:R(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e}]});else if(l)f=tB({positionType:`bottom`,positionData:e.depth+o,children:[{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:R(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]});else return e;var p=[f];if(c&&a!==0&&!s){var m=J([`mspace`],[],r);m.style.marginRight=R(a),p.unshift(m)}return J([`mop`,`op-limits`],p,r)},VH=new Set([`\\smallint`]),HH=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=cV(e.base,`op`),i=!0):a=cV(e,`op`);var o=t.style,s=!1;o.size===oR.DISPLAY.size&&a.symbol&&!VH.has(a.name)&&(s=!0);var c,l;if(a.symbol){var u=s?`Size2-Regular`:`Size1-Regular`,d=``;if((a.name===`\\oiint`||a.name===`\\oiiint`)&&(d=a.name.slice(1),a.name=d===`oiint`?`\\iint`:`\\iiint`),c=Hz(a.name,u,`math`,t,[`mop`,`op-symbol`,s?`large-op`:`small-op`]),l=c.italic,d.length>0){var f=oB(d+`Size`+(s?`2`:`1`),t);c=tB({positionType:`individualShift`,children:[{type:`elem`,elem:c,shift:0},{type:`elem`,elem:f,shift:s?.08:0}]}),a.name=`\\`+d,c.classes.unshift(`mop`),c.italic=l}}else if(a.body){var p=SB(a.body,t,!0);p.length===1&&p[0]instanceof BR?(c=p[0],c.classes[0]=`mop`):c=J([`mop`],p,t)}else{for(var m=[],h=1;h<a.name.length;h++)m.push(Uz(a.name[h],a.mode,t));c=J([`mop`],m,t)}var g=0,_=0;return(c instanceof BR||a.name===`\\oiint`||a.name===`\\oiiint`)&&!a.suppressBaseShift&&(g=(c.height-c.depth)/2-t.fontMetrics().axisHeight,_=c.italic??0),i?BH(c,n,r,t,o,_,g):(g&&(c.style.position=`relative`,c.style.top=R(g)),c)},UH=(e,t)=>{var n;if(e.symbol)n=new X(`mo`,[IB(e.name,e.mode)]),VH.has(e.name)&&n.setAttribute(`largeop`,`false`);else if(e.body)n=new X(`mo`,VB(e.body,t));else{n=new X(`mi`,[new MB(e.name.slice(1))]);var r=new X(`mo`,[IB(``,`text`)]);n=e.parentIsSupSub?new X(`mrow`,[n,r]):jB([n,r])}return n},WH={"∏":`\\prod`,"∐":`\\coprod`,"∑":`\\sum`,"⋀":`\\bigwedge`,"⋁":`\\bigvee`,"⋂":`\\bigcap`,"⋃":`\\bigcup`,"⨀":`\\bigodot`,"⨁":`\\bigoplus`,"⨂":`\\bigotimes`,"⨄":`\\biguplus`,"⨆":`\\bigsqcup`};Y({type:`op`,names:`\\coprod.\\bigvee.\\bigwedge.\\biguplus.\\bigcap.\\bigcup.\\intop.\\prod.\\sum.\\bigotimes.\\bigoplus.\\bigodot.\\bigsqcup.\\smallint.∏.∐.∑.⋀.⋁.⋂.⋃.⨀.⨁.⨂.⨄.⨆`.split(`.`),props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=r;return i.length===1&&(i=WH[i]),{type:`op`,mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:HH,mathmlBuilder:UH}),Y({type:`op`,names:[`\\mathop`],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`op`,mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:_B(r)}},htmlBuilder:HH,mathmlBuilder:UH});var GH={"∫":`\\int`,"∬":`\\iint`,"∭":`\\iiint`,"∮":`\\oint`,"∯":`\\oiint`,"∰":`\\oiiint`};Y({type:`op`,names:`\\arcsin.\\arccos.\\arctan.\\arctg.\\arcctg.\\arg.\\ch.\\cos.\\cosec.\\cosh.\\cot.\\cotg.\\coth.\\csc.\\ctg.\\cth.\\deg.\\dim.\\exp.\\hom.\\ker.\\lg.\\ln.\\log.\\sec.\\sin.\\sinh.\\sh.\\tan.\\tanh.\\tg.\\th`.split(`.`),props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:HH,mathmlBuilder:UH}),Y({type:`op`,names:[`\\det`,`\\gcd`,`\\inf`,`\\lim`,`\\max`,`\\min`,`\\Pr`,`\\sup`],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:`op`,mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:HH,mathmlBuilder:UH}),Y({type:`op`,names:[`\\int`,`\\iint`,`\\iiint`,`\\oint`,`\\oiint`,`\\oiiint`,`∫`,`∬`,`∭`,`∮`,`∯`,`∰`],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:t,funcName:n}=e,r=n;return r.length===1&&(r=GH[r]),{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:HH,mathmlBuilder:UH});var KH=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=cV(e.base,`operatorname`),i=!0):a=cV(e,`operatorname`);var o;if(a.body.length>0){for(var s=SB(a.body.map(e=>{var t=`text`in e?e.text:void 0;return typeof t==`string`?{type:`textord`,mode:e.mode,text:t}:e}),t.withFont(`mathrm`),!0),c=0;c<s.length;c++){var l=s[c];l instanceof BR&&(l.text=l.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`))}o=J([`mop`],s,t)}else o=J([`mop`],[],t);return i?BH(o,n,r,t,t.style,0,0):o};Y({type:`operatorname`,names:[`\\operatorname@`,`\\operatornamewithlimits`],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:`operatorname`,mode:n.mode,body:_B(i),alwaysHandleSupSub:r===`\\operatornamewithlimits`,limits:!1,parentIsSupSub:!1}},htmlBuilder:KH,mathmlBuilder:(e,t)=>{for(var n=VB(e.body,t.withFont(`mathrm`)),r=!0,i=0;i<n.length;i++){var a=n[i];if(!(a instanceof NB))if(a instanceof X)switch(a.type){case`mi`:case`mn`:case`mspace`:case`mtext`:break;case`mo`:var o=a.children[0];a.children.length===1&&o instanceof MB?o.text=o.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`):r=!1;break;default:r=!1}else r=!1}r&&(n=[new MB(n.map(e=>e.toText()).join(``))]);var s=new X(`mi`,n);s.setAttribute(`mathvariant`,`normal`);var c=new X(`mo`,[IB(``,`text`)]);return e.parentIsSupSub?new X(`mrow`,[s,c]):jB([s,c])}}),Z(`\\operatorname`,`\\@ifstar\\operatornamewithlimits\\operatorname@`),hB({type:`ordgroup`,htmlBuilder(e,t){return e.semisimple?Qz(SB(e.body,t,!1)):J([`mord`],SB(e.body,t,!0),t)},mathmlBuilder(e,t){return HB(e.body,t,!0)}}),Y({type:`overline`,names:[`\\overline`],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:`overline`,mode:n.mode,body:r}},htmlBuilder(e,t){var n=OB(e.body,t.havingCrampedStyle()),r=Xz(`overline-line`,t),i=t.fontMetrics().defaultRuleThickness;return J([`mord`,`overline`],[tB({positionType:`firstBaseline`,children:[{type:`elem`,elem:n},{type:`kern`,size:3*i},{type:`elem`,elem:r},{type:`kern`,size:i}]})],t)},mathmlBuilder(e,t){var n=new X(`mo`,[new MB(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new X(`mover`,[UB(e.body,t),n]);return r.setAttribute(`accent`,`true`),r}}),Y({type:`phantom`,names:[`\\phantom`],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`phantom`,mode:n.mode,body:_B(r)}},htmlBuilder:(e,t)=>Qz(SB(e.body,t.withPhantom(),!1)),mathmlBuilder:(e,t)=>new X(`mphantom`,VB(e.body,t))}),Z(`\\hphantom`,`\\smash{\\phantom{#1}}`),Y({type:`vphantom`,names:[`\\vphantom`],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`vphantom`,mode:n.mode,body:r}},htmlBuilder:(e,t)=>J([`mord`,`rlap`],[J([`inner`],[OB(e.body,t.withPhantom())]),J([`fix`],[])],t),mathmlBuilder:(e,t)=>{var n=new X(`mpadded`,[new X(`mphantom`,VB(_B(e.body),t))]);return n.setAttribute(`width`,`0px`),n}}),Y({type:`raisebox`,names:[`\\raisebox`],props:{numArgs:2,argTypes:[`size`,`hbox`],allowedInText:!0},handler(e,t){var{parser:n}=e,r=cV(t[0],`size`).value,i=t[1];return{type:`raisebox`,mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=OB(e.body,t);return tB({positionType:`shift`,positionData:-kR(e.dy,t),children:[{type:`elem`,elem:n}]})},mathmlBuilder(e,t){var n=new X(`mpadded`,[UB(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute(`voffset`,r),n}}),Y({type:`internal`,names:[`\\relax`],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:`internal`,mode:t.mode}}}),Y({type:`rule`,names:[`\\rule`],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`size`,`size`,`size`]},handler(e,t,n){var{parser:r}=e,i=n[0],a=cV(t[0],`size`),o=cV(t[1],`size`);return{type:`rule`,mode:r.mode,shift:i&&cV(i,`size`).value,width:a.value,height:o.value}},htmlBuilder(e,t){var n=J([`mord`,`rule`],[],t),r=kR(e.width,t),i=kR(e.height,t),a=e.shift?kR(e.shift,t):0;return n.style.borderRightWidth=R(r),n.style.borderTopWidth=R(i),n.style.bottom=R(a),n.width=r,n.height=i+a,n.depth=-a,n.maxFontSize=i*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=kR(e.width,t),r=kR(e.height,t),i=e.shift?kR(e.shift,t):0,a=t.color&&t.getColor()||`black`,o=new X(`mspace`);o.setAttribute(`mathbackground`,a),o.setAttribute(`width`,R(n)),o.setAttribute(`height`,R(r));var s=new X(`mpadded`,[o]);return i>=0?s.setAttribute(`height`,R(i)):(s.setAttribute(`height`,R(i)),s.setAttribute(`depth`,R(-i))),s.setAttribute(`voffset`,R(i)),s}});function qH(e,t,n){for(var r=SB(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,a=0;a<r.length;a++){var o=r[a].classes.indexOf(`sizing`);o<0?Array.prototype.push.apply(r[a].classes,t.sizingClasses(n)):r[a].classes[o+1]===`reset-size`+t.size&&(r[a].classes[o+1]=`reset-size`+n.size),r[a].height*=i,r[a].depth*=i}return Qz(r)}var JH=[`\\tiny`,`\\sixptsize`,`\\scriptsize`,`\\footnotesize`,`\\small`,`\\normalsize`,`\\large`,`\\Large`,`\\LARGE`,`\\huge`,`\\Huge`];Y({type:`sizing`,names:JH,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!1,n);return{type:`sizing`,mode:i.mode,size:JH.indexOf(r)+1,body:a}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return qH(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=new X(`mstyle`,VB(e.body,n));return r.setAttribute(`mathsize`,R(n.sizeMultiplier)),r}}),Y({type:`smash`,names:[`\\smash`],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,i=!1,a=!1,o=n[0]&&cV(n[0],`ordgroup`);if(o)for(var s,c=0;c<o.body.length;++c){var l=o.body[c];if(s=lV(l).text,s===`t`)i=!0;else if(s===`b`)a=!0;else{i=!1,a=!1;break}}else i=!0,a=!0;var u=t[0];return{type:`smash`,mode:r.mode,body:u,smashHeight:i,smashDepth:a}},htmlBuilder:(e,t)=>{var n=J([],[OB(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0),e.smashDepth&&(n.depth=0),e.smashHeight&&e.smashDepth)return J([`mord`,`smash`],[n],t);if(n.children)for(var r=0;r<n.children.length;r++)e.smashHeight&&(n.children[r].height=0),e.smashDepth&&(n.children[r].depth=0);return J([`mord`],[tB({positionType:`firstBaseline`,children:[{type:`elem`,elem:n}]})],t)},mathmlBuilder:(e,t)=>{var n=new X(`mpadded`,[UB(e.body,t)]);return e.smashHeight&&n.setAttribute(`height`,`0px`),e.smashDepth&&n.setAttribute(`depth`,`0px`),n}}),Y({type:`sqrt`,names:[`\\sqrt`],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r}=e,i=n[0],a=t[0];return{type:`sqrt`,mode:r.mode,body:a,index:i}},htmlBuilder(e,t){var n=OB(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=$z(n,t);var r=t.fontMetrics().defaultRuleThickness,i=r;t.style.id<oR.TEXT.id&&(i=t.fontMetrics().xHeight);var a=r+i/4,{span:o,ruleWidth:s,advanceWidth:c}=qV(n.height+n.depth+a+r,t),l=o.height-s;l>n.height+n.depth+a&&(a=(a+l-n.height-n.depth)/2);var u=o.height-n.height-a-s;n.style.paddingLeft=R(c);var d=tB({positionType:`firstBaseline`,children:[{type:`elem`,elem:n,wrapperClasses:[`svg-align`]},{type:`kern`,size:-(n.height+u)},{type:`elem`,elem:o},{type:`kern`,size:s}]});if(e.index){var f=t.havingStyle(oR.SCRIPTSCRIPT),p=OB(e.index,f,t);return J([`mord`,`sqrt`],[J([`root`],[tB({positionType:`shift`,positionData:-(.6*(d.height-d.depth)),children:[{type:`elem`,elem:p}]})]),d],t)}else return J([`mord`,`sqrt`],[d],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new X(`mroot`,[UB(n,t),UB(r,t)]):new X(`msqrt`,[UB(n,t)])}});var YH={display:oR.DISPLAY,text:oR.TEXT,script:oR.SCRIPT,scriptscript:oR.SCRIPTSCRIPT};function XH(e){return e in YH}Y({type:`styling`,names:[`\\displaystyle`,`\\textstyle`,`\\scriptstyle`,`\\scriptscriptstyle`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!0,n),o=r.slice(1,r.length-5);if(!XH(o))throw Error(`Unknown style: `+o);return{type:`styling`,mode:i.mode,style:o,body:a}},htmlBuilder(e,t){var n=YH[e.style],r=t.havingStyle(n);return e.resetFont&&(r=r.withFont(``)),qH(e.body,r,t)},mathmlBuilder(e,t){var n=YH[e.style],r=t.havingStyle(n);e.resetFont&&(r=r.withFont(``));var i=new X(`mstyle`,VB(e.body,r)),a={display:[`0`,`true`],text:[`0`,`false`],script:[`1`,`false`],scriptscript:[`2`,`false`]}[e.style];return i.setAttribute(`scriptlevel`,a[0]),i.setAttribute(`displaystyle`,a[1]),i}});var ZH=function(e,t){var n=e.base;return n?n.type===`op`?n.limits&&(t.style.size===oR.DISPLAY.size||n.alwaysHandleSupSub)?HH:null:n.type===`operatorname`?n.alwaysHandleSupSub&&(t.style.size===oR.DISPLAY.size||n.limits)?KH:null:n.type===`accent`?LL(n.base)?fV:null:n.type===`horizBrace`&&!e.sub===n.isOver?LH:null:null};hB({type:`supsub`,htmlBuilder(e,t){var n=ZH(e,t);if(n)return n(e,t);var{base:r,sup:i,sub:a}=e,o=OB(r,t),s,c,l=t.fontMetrics(),u=0,d=0,f=r&&LL(r);if(i){var p=t.havingStyle(t.style.sup());s=OB(i,p,t),f||(u=o.height-p.fontMetrics().supDrop*p.sizeMultiplier/t.sizeMultiplier)}if(a){var m=t.havingStyle(t.style.sub());c=OB(a,m,t),f||(d=o.depth+m.fontMetrics().subDrop*m.sizeMultiplier/t.sizeMultiplier)}var h=t.style===oR.DISPLAY?l.sup1:t.style.cramped?l.sup3:l.sup2,g=t.sizeMultiplier,_=R(.5/l.ptPerEm/g),v=null;if(c){var y=e.base&&e.base.type===`op`&&e.base.name&&(e.base.name===`\\oiint`||e.base.name===`\\oiiint`);(o instanceof BR||y)&&(v=R(-(o.italic??0)))}var b;if(s&&c){u=Math.max(u,h,s.depth+.25*l.xHeight),d=Math.max(d,l.sub2);var x=4*l.defaultRuleThickness;if(u-s.depth-(c.height-d)<x){d=x-(u-s.depth)+c.height;var S=.8*l.xHeight-(u-s.depth);S>0&&(u+=S,d-=S)}b=tB({positionType:`individualShift`,children:[{type:`elem`,elem:c,shift:d,marginRight:_,marginLeft:v},{type:`elem`,elem:s,shift:-u,marginRight:_}]})}else if(c)d=Math.max(d,l.sub1,c.height-.8*l.xHeight),b=tB({positionType:`shift`,positionData:d,children:[{type:`elem`,elem:c,marginLeft:v,marginRight:_}]});else if(s)u=Math.max(u,h,s.depth+.25*l.xHeight),b=tB({positionType:`shift`,positionData:-u,children:[{type:`elem`,elem:s,marginRight:_}]});else throw Error(`supsub must have either sup or sub.`);return J([EB(o,`right`)||`mord`],[o,J([`msupsub`],[b])],t)},mathmlBuilder(e,t){var n=!1,r,i;e.base&&e.base.type===`horizBrace`&&(i=!!e.sup,i===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&(e.base.type===`op`||e.base.type===`operatorname`)&&(e.base.parentIsSupSub=!0);var a=[UB(e.base,t)];e.sub&&a.push(UB(e.sub,t)),e.sup&&a.push(UB(e.sup,t));var o;if(n)o=r?`mover`:`munder`;else if(!e.sub){var s=e.base;o=s&&s.type===`op`&&s.limits&&(t.style===oR.DISPLAY||s.alwaysHandleSupSub)||s&&s.type===`operatorname`&&s.alwaysHandleSupSub&&(s.limits||t.style===oR.DISPLAY)?`mover`:`msup`}else if(e.sup){var c=e.base;o=c&&c.type===`op`&&c.limits&&t.style===oR.DISPLAY||c&&c.type===`operatorname`&&c.alwaysHandleSupSub&&(t.style===oR.DISPLAY||c.limits)?`munderover`:`msubsup`}else{var l=e.base;o=l&&l.type===`op`&&l.limits&&(t.style===oR.DISPLAY||l.alwaysHandleSupSub)||l&&l.type===`operatorname`&&l.alwaysHandleSupSub&&(l.limits||t.style===oR.DISPLAY)?`munder`:`msub`}return new X(o,a)}}),hB({type:`atom`,htmlBuilder(e,t){return Uz(e.text,e.mode,t,[`m`+e.family])},mathmlBuilder(e,t){var n=new X(`mo`,[IB(e.text,e.mode)]);if(e.family===`bin`){var r=zB(e,t);r===`bold-italic`&&n.setAttribute(`mathvariant`,r)}else e.family===`punct`?n.setAttribute(`separator`,`true`):(e.family===`open`||e.family===`close`)&&n.setAttribute(`stretchy`,`false`);return n}});var QH={mi:`italic`,mn:`normal`,mtext:`normal`};hB({type:`mathord`,htmlBuilder(e,t){return Gz(e,t,`mathord`)},mathmlBuilder(e,t){var n=new X(`mi`,[IB(e.text,e.mode,t)]),r=zB(e,t)||`italic`;return r!==QH[n.type]&&n.setAttribute(`mathvariant`,r),n}}),hB({type:`textord`,htmlBuilder(e,t){return Gz(e,t,`textord`)},mathmlBuilder(e,t){var n=IB(e.text,e.mode,t),r=zB(e,t)||`normal`,i=e.mode===`text`?new X(`mtext`,[n]):/[0-9]/.test(e.text)?new X(`mn`,[n]):e.text===`\\prime`?new X(`mo`,[n]):new X(`mi`,[n]);return r!==QH[i.type]&&i.setAttribute(`mathvariant`,r),i}});var $H={"\\nobreak":`nobreak`,"\\allowbreak":`allowbreak`},eU={" ":{},"\\ ":{},"~":{className:`nobreak`},"\\space":{},"\\nobreakspace":{className:`nobreak`}};hB({type:`spacing`,htmlBuilder(e,t){if(eU.hasOwnProperty(e.text)){var n=eU[e.text].className||``;if(e.mode===`text`){var r=Gz(e,t,`textord`);return r.classes.push(n),r}else return J([`mspace`,n],[Uz(e.text,e.mode,t)],t)}else if($H.hasOwnProperty(e.text))return J([`mspace`,$H[e.text]],[],t);else throw new L(`Unknown type of space "`+e.text+`"`)},mathmlBuilder(e,t){var n;if(eU.hasOwnProperty(e.text))n=new X(`mtext`,[new MB(`\xA0`)]);else if($H.hasOwnProperty(e.text))return new X(`mspace`);else throw new L(`Unknown type of space "`+e.text+`"`);return n}});var tU=()=>{var e=new X(`mtd`,[]);return e.setAttribute(`width`,`50%`),e};hB({type:`tag`,mathmlBuilder(e,t){var n=new X(`mtable`,[new X(`mtr`,[tU(),new X(`mtd`,[HB(e.body,t)]),tU(),new X(`mtd`,[HB(e.tag,t)])])]);return n.setAttribute(`width`,`100%`),n}});var nU={"\\text":void 0,"\\textrm":`textrm`,"\\textsf":`textsf`,"\\texttt":`texttt`,"\\textnormal":`textrm`},rU={"\\textbf":`textbf`,"\\textmd":`textmd`},iU={"\\textit":`textit`,"\\textup":`textup`},aU=(e,t)=>{var n=e.font;return n?nU[n]?t.withTextFontFamily(nU[n]):rU[n]?t.withTextFontWeight(rU[n]):n===`\\emph`?t.fontShape===`textit`?t.withTextFontShape(`textup`):t.withTextFontShape(`textit`):t.withTextFontShape(iU[n]):t};Y({type:`text`,names:[`\\text`,`\\textrm`,`\\textsf`,`\\texttt`,`\\textnormal`,`\\textbf`,`\\textmd`,`\\textit`,`\\textup`,`\\emph`],props:{numArgs:1,argTypes:[`text`],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:`text`,mode:n.mode,body:_B(i),font:r}},htmlBuilder(e,t){var n=aU(e,t);return J([`mord`,`text`],SB(e.body,n,!0),n)},mathmlBuilder(e,t){var n=aU(e,t);return HB(e.body,n)}}),Y({type:`underline`,names:[`\\underline`],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:`underline`,mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=OB(e.body,t),r=Xz(`underline-line`,t),i=t.fontMetrics().defaultRuleThickness;return J([`mord`,`underline`],[tB({positionType:`top`,positionData:n.height,children:[{type:`kern`,size:i},{type:`elem`,elem:r},{type:`kern`,size:3*i},{type:`elem`,elem:n}]})],t)},mathmlBuilder(e,t){var n=new X(`mo`,[new MB(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new X(`munder`,[UB(e.body,t),n]);return r.setAttribute(`accentunder`,`true`),r}}),Y({type:`vcenter`,names:[`\\vcenter`],props:{numArgs:1,argTypes:[`original`],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:`vcenter`,mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=OB(e.body,t),r=t.fontMetrics().axisHeight;return tB({positionType:`shift`,positionData:.5*(n.height-r-(n.depth+r)),children:[{type:`elem`,elem:n}]})},mathmlBuilder(e,t){return new X(`mrow`,[new X(`mpadded`,[UB(e.body,t)],[`vcenter`])])}}),Y({type:`verb`,names:[`\\verb`],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new L(`\\verb ended by end of line instead of matching delimiter`)},htmlBuilder(e,t){for(var n=oU(e),r=[],i=t.havingStyle(t.style.text()),a=0;a<n.length;a++){var o=n[a];o===`~`&&(o=`\\textasciitilde`),r.push(Hz(o,`Typewriter-Regular`,e.mode,i,[`mord`,`texttt`]))}return J([`mord`,`text`].concat(i.sizingClasses(t)),qz(r),i)},mathmlBuilder(e,t){var n=new X(`mtext`,[new MB(oU(e))]);return n.setAttribute(`mathvariant`,`monospace`),n}});var oU=e=>e.body.replace(/ /g,e.star?`␣`:`\xA0`),sU=fB,cU=`[ \r
|
|
349
|
+
]`,lU=`\\\\[a-zA-Z@]+`,uU=`\\\\[^\ud800-\udfff]`,dU=`(`+lU+`)`+cU+`*`,fU=`\\\\(
|
|
298
350
|
|[ \r ]+
|
|
299
|
-
?)[ \r ]*`,
|
|
300
|
-
`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict(`commentAtEnd`,`% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)`)):this.tokenRegex.lastIndex=i+1,this.lex()}return new bm(r,new ym(this,t,this.tokenRegex.lastIndex))}},bh=class{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new N(`Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug`);var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(e[t]==null?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(n===void 0&&(n=!1),n){for(var r=0;r<this.undefStack.length;r++)delete this.undefStack[r][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(e)&&(i[e]=this.current[e])}t==null?delete this.current[e]:this.current[e]=t}},xh=vm;X(`\\noexpand`,function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),X(`\\expandafter`,function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),X(`\\@firstoftwo`,function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),X(`\\@secondoftwo`,function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),X(`\\@ifnextchar`,function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),X(`\\@ifstar`,`\\@ifnextchar *{\\@firstoftwo{#1}}`),X(`\\TextOrMath`,function(e){var t=e.consumeArgs(2);return e.mode===`text`?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var Sh={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};X(`\\char`,function(e){var t=e.popToken(),n,r=0;if(t.text===`'`)n=8,t=e.popToken();else if(t.text===`"`)n=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]===`\\`)r=t.text.charCodeAt(1);else if(t.text===`EOF`)throw new N("\\char` missing argument");else r=t.text.charCodeAt(0);else n=10;if(n){if(r=Sh[t.text],r==null||r>=n)throw new N(`Invalid base-`+n+` digit `+t.text);for(var i;(i=Sh[e.future().text])!=null&&i<n;)r*=n,r+=i,e.popToken()}return`\\@char{`+r+`}`});var Ch=(e,t,n,r)=>{var i=e.consumeArg().tokens;if(i.length!==1)throw new N(`\\newcommand's first argument must be a macro name`);var a=i[0].text,o=e.isDefined(a);if(o&&!t)throw new N(`\\newcommand{`+a+`} attempting to redefine `+(a+`; use \\renewcommand`));if(!o&&!n)throw new N(`\\renewcommand{`+a+`} when command `+a+` does not yet exist; use \\newcommand`);var s=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text===`[`){for(var c=``,l=e.expandNextToken();l.text!==`]`&&l.text!==`EOF`;)c+=l.text,l=e.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new N(`Invalid number of arguments: `+c);s=parseInt(c),i=e.consumeArg().tokens}return o&&r||e.macros.set(a,{tokens:i,numArgs:s}),``};X(`\\newcommand`,e=>Ch(e,!1,!0,!1)),X(`\\renewcommand`,e=>Ch(e,!0,!1,!1)),X(`\\providecommand`,e=>Ch(e,!0,!0,!0)),X(`\\message`,e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join(``)),``}),X(`\\errmessage`,e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join(``)),``}),X(`\\show`,e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),uh[n],id.math[n],id.text[n]),``}),X(`\\bgroup`,`{`),X(`\\egroup`,`}`),X(`~`,`\\nobreakspace`),X(`\\lq`,"`"),X(`\\rq`,`'`),X(`\\aa`,`\\r a`),X(`\\AA`,`\\r A`),X(`\\textcopyright`,"\\html@mathml{\\textcircled{c}}{\\char`©}"),X(`\\copyright`,`\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}`),X(`\\textregistered`,"\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),X(`ℬ`,`\\mathscr{B}`),X(`ℰ`,`\\mathscr{E}`),X(`ℱ`,`\\mathscr{F}`),X(`ℋ`,`\\mathscr{H}`),X(`ℐ`,`\\mathscr{I}`),X(`ℒ`,`\\mathscr{L}`),X(`ℳ`,`\\mathscr{M}`),X(`ℛ`,`\\mathscr{R}`),X(`ℭ`,`\\mathfrak{C}`),X(`ℌ`,`\\mathfrak{H}`),X(`ℨ`,`\\mathfrak{Z}`),X(`\\Bbbk`,`\\Bbb{k}`),X(`\\llap`,`\\mathllap{\\textrm{#1}}`),X(`\\rlap`,`\\mathrlap{\\textrm{#1}}`),X(`\\clap`,`\\mathclap{\\textrm{#1}}`),X(`\\mathstrut`,`\\vphantom{(}`),X(`\\underbar`,`\\underline{\\text{#1}}`),X(`\\not`,`\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}`),X(`\\neq`,"\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),X(`\\ne`,`\\neq`),X(`≠`,`\\neq`),X(`\\notin`,"\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),X(`∉`,`\\notin`),X(`≘`,"\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),X(`≙`,"\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),X(`≚`,"\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),X(`≛`,"\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),X(`≝`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),X(`≞`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),X(`≟`,"\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),X(`⟂`,`\\perp`),X(`‼`,`\\mathclose{!\\mkern-0.8mu!}`),X(`∌`,`\\notni`),X(`⌜`,`\\ulcorner`),X(`⌝`,`\\urcorner`),X(`⌞`,`\\llcorner`),X(`⌟`,`\\lrcorner`),X(`©`,`\\copyright`),X(`®`,`\\textregistered`),X(`\\ulcorner`,`\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}`),X(`\\urcorner`,`\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}`),X(`\\llcorner`,`\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}`),X(`\\lrcorner`,`\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}`),X(`\\vdots`,`{\\varvdots\\rule{0pt}{15pt}}`),X(`⋮`,`\\vdots`),X(`\\varGamma`,`\\mathit{\\Gamma}`),X(`\\varDelta`,`\\mathit{\\Delta}`),X(`\\varTheta`,`\\mathit{\\Theta}`),X(`\\varLambda`,`\\mathit{\\Lambda}`),X(`\\varXi`,`\\mathit{\\Xi}`),X(`\\varPi`,`\\mathit{\\Pi}`),X(`\\varSigma`,`\\mathit{\\Sigma}`),X(`\\varUpsilon`,`\\mathit{\\Upsilon}`),X(`\\varPhi`,`\\mathit{\\Phi}`),X(`\\varPsi`,`\\mathit{\\Psi}`),X(`\\varOmega`,`\\mathit{\\Omega}`),X(`\\substack`,`\\begin{subarray}{c}#1\\end{subarray}`),X(`\\colon`,`\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax`),X(`\\boxed`,`\\fbox{$\\displaystyle{#1}$}`),X(`\\iff`,`\\DOTSB\\;\\Longleftrightarrow\\;`),X(`\\implies`,`\\DOTSB\\;\\Longrightarrow\\;`),X(`\\impliedby`,`\\DOTSB\\;\\Longleftarrow\\;`),X(`\\dddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}`),X(`\\ddddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}`);var wh={",":`\\dotsc`,"\\not":`\\dotsb`,"+":`\\dotsb`,"=":`\\dotsb`,"<":`\\dotsb`,">":`\\dotsb`,"-":`\\dotsb`,"*":`\\dotsb`,":":`\\dotsb`,"\\DOTSB":`\\dotsb`,"\\coprod":`\\dotsb`,"\\bigvee":`\\dotsb`,"\\bigwedge":`\\dotsb`,"\\biguplus":`\\dotsb`,"\\bigcap":`\\dotsb`,"\\bigcup":`\\dotsb`,"\\prod":`\\dotsb`,"\\sum":`\\dotsb`,"\\bigotimes":`\\dotsb`,"\\bigoplus":`\\dotsb`,"\\bigodot":`\\dotsb`,"\\bigsqcup":`\\dotsb`,"\\And":`\\dotsb`,"\\longrightarrow":`\\dotsb`,"\\Longrightarrow":`\\dotsb`,"\\longleftarrow":`\\dotsb`,"\\Longleftarrow":`\\dotsb`,"\\longleftrightarrow":`\\dotsb`,"\\Longleftrightarrow":`\\dotsb`,"\\mapsto":`\\dotsb`,"\\longmapsto":`\\dotsb`,"\\hookrightarrow":`\\dotsb`,"\\doteq":`\\dotsb`,"\\mathbin":`\\dotsb`,"\\mathrel":`\\dotsb`,"\\relbar":`\\dotsb`,"\\Relbar":`\\dotsb`,"\\xrightarrow":`\\dotsb`,"\\xleftarrow":`\\dotsb`,"\\DOTSI":`\\dotsi`,"\\int":`\\dotsi`,"\\oint":`\\dotsi`,"\\iint":`\\dotsi`,"\\iiint":`\\dotsi`,"\\iiiint":`\\dotsi`,"\\idotsint":`\\dotsi`,"\\DOTSX":`\\dotsx`},Th=new Set([`bin`,`rel`]);X(`\\dots`,function(e){var t=`\\dotso`,n=e.expandAfterFuture().text;return n in wh?t=wh[n]:(n.slice(0,4)===`\\not`||n in id.math&&Th.has(id.math[n].group))&&(t=`\\dotsb`),t});var Eh={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};X(`\\dotso`,function(e){return e.future().text in Eh?`\\ldots\\,`:`\\ldots`}),X(`\\dotsc`,function(e){var t=e.future().text;return t in Eh&&t!==`,`?`\\ldots\\,`:`\\ldots`}),X(`\\cdots`,function(e){return e.future().text in Eh?`\\@cdots\\,`:`\\@cdots`}),X(`\\dotsb`,`\\cdots`),X(`\\dotsm`,`\\cdots`),X(`\\dotsi`,`\\!\\cdots`),X(`\\dotsx`,`\\ldots\\,`),X(`\\DOTSI`,`\\relax`),X(`\\DOTSB`,`\\relax`),X(`\\DOTSX`,`\\relax`),X(`\\tmspace`,`\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax`),X(`\\,`,`\\tmspace+{3mu}{.1667em}`),X(`\\thinspace`,`\\,`),X(`\\>`,`\\mskip{4mu}`),X(`\\:`,`\\tmspace+{4mu}{.2222em}`),X(`\\medspace`,`\\:`),X(`\\;`,`\\tmspace+{5mu}{.2777em}`),X(`\\thickspace`,`\\;`),X(`\\!`,`\\tmspace-{3mu}{.1667em}`),X(`\\negthinspace`,`\\!`),X(`\\negmedspace`,`\\tmspace-{4mu}{.2222em}`),X(`\\negthickspace`,`\\tmspace-{5mu}{.277em}`),X(`\\enspace`,`\\kern.5em `),X(`\\enskip`,`\\hskip.5em\\relax`),X(`\\quad`,`\\hskip1em\\relax`),X(`\\qquad`,`\\hskip2em\\relax`),X(`\\tag`,`\\@ifstar\\tag@literal\\tag@paren`),X(`\\tag@paren`,`\\tag@literal{({#1})}`),X(`\\tag@literal`,e=>{if(e.macros.get(`\\df@tag`))throw new N(`Multiple \\tag`);return`\\gdef\\df@tag{\\text{#1}}`}),X(`\\bmod`,`\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}`),X(`\\pod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)`),X(`\\pmod`,`\\pod{{\\rm mod}\\mkern6mu#1}`),X(`\\mod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1`),X(`\\newline`,`\\\\\\relax`),X(`\\TeX`,`\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}`);var Dh=F(Zu[`Main-Regular`][84][1]-.7*Zu[`Main-Regular`][65][1]);X(`\\LaTeX`,`\\textrm{\\html@mathml{`+(`L\\kern-.36em\\raisebox{`+Dh+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{LaTeX}}`),X(`\\KaTeX`,`\\textrm{\\html@mathml{`+(`K\\kern-.17em\\raisebox{`+Dh+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{KaTeX}}`),X(`\\hspace`,`\\@ifstar\\@hspacer\\@hspace`),X(`\\@hspace`,`\\hskip #1\\relax`),X(`\\@hspacer`,`\\rule{0pt}{0pt}\\hskip #1\\relax`),X(`\\ordinarycolon`,`:`),X(`\\vcentcolon`,`\\mathrel{\\mathop\\ordinarycolon}`),X(`\\dblcolon`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}`),X(`\\coloneqq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}`),X(`\\Coloneqq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}`),X(`\\coloneq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}`),X(`\\Coloneq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}`),X(`\\eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}`),X(`\\Eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}`),X(`\\eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}`),X(`\\Eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}`),X(`\\colonapprox`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}`),X(`\\Colonapprox`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}`),X(`\\colonsim`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}`),X(`\\Colonsim`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}`),X(`∷`,`\\dblcolon`),X(`∹`,`\\eqcolon`),X(`≔`,`\\coloneqq`),X(`≕`,`\\eqqcolon`),X(`⩴`,`\\Coloneqq`),X(`\\ratio`,`\\vcentcolon`),X(`\\coloncolon`,`\\dblcolon`),X(`\\colonequals`,`\\coloneqq`),X(`\\coloncolonequals`,`\\Coloneqq`),X(`\\equalscolon`,`\\eqqcolon`),X(`\\equalscoloncolon`,`\\Eqqcolon`),X(`\\colonminus`,`\\coloneq`),X(`\\coloncolonminus`,`\\Coloneq`),X(`\\minuscolon`,`\\eqcolon`),X(`\\minuscoloncolon`,`\\Eqcolon`),X(`\\coloncolonapprox`,`\\Colonapprox`),X(`\\coloncolonsim`,`\\Colonsim`),X(`\\simcolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),X(`\\simcoloncolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}`),X(`\\approxcolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),X(`\\approxcoloncolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}`),X(`\\notni`,"\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),X(`\\limsup`,`\\DOTSB\\operatorname*{lim\\,sup}`),X(`\\liminf`,`\\DOTSB\\operatorname*{lim\\,inf}`),X(`\\injlim`,`\\DOTSB\\operatorname*{inj\\,lim}`),X(`\\projlim`,`\\DOTSB\\operatorname*{proj\\,lim}`),X(`\\varlimsup`,`\\DOTSB\\operatorname*{\\overline{lim}}`),X(`\\varliminf`,`\\DOTSB\\operatorname*{\\underline{lim}}`),X(`\\varinjlim`,`\\DOTSB\\operatorname*{\\underrightarrow{lim}}`),X(`\\varprojlim`,`\\DOTSB\\operatorname*{\\underleftarrow{lim}}`),X(`\\gvertneqq`,`\\html@mathml{\\@gvertneqq}{≩}`),X(`\\lvertneqq`,`\\html@mathml{\\@lvertneqq}{≨}`),X(`\\ngeqq`,`\\html@mathml{\\@ngeqq}{≱}`),X(`\\ngeqslant`,`\\html@mathml{\\@ngeqslant}{≱}`),X(`\\nleqq`,`\\html@mathml{\\@nleqq}{≰}`),X(`\\nleqslant`,`\\html@mathml{\\@nleqslant}{≰}`),X(`\\nshortmid`,`\\html@mathml{\\@nshortmid}{∤}`),X(`\\nshortparallel`,`\\html@mathml{\\@nshortparallel}{∦}`),X(`\\nsubseteqq`,`\\html@mathml{\\@nsubseteqq}{⊈}`),X(`\\nsupseteqq`,`\\html@mathml{\\@nsupseteqq}{⊉}`),X(`\\varsubsetneq`,`\\html@mathml{\\@varsubsetneq}{⊊}`),X(`\\varsubsetneqq`,`\\html@mathml{\\@varsubsetneqq}{⫋}`),X(`\\varsupsetneq`,`\\html@mathml{\\@varsupsetneq}{⊋}`),X(`\\varsupsetneqq`,`\\html@mathml{\\@varsupsetneqq}{⫌}`),X(`\\imath`,`\\html@mathml{\\@imath}{ı}`),X(`\\jmath`,`\\html@mathml{\\@jmath}{ȷ}`),X(`\\llbracket`,"\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),X(`\\rrbracket`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),X(`⟦`,`\\llbracket`),X(`⟧`,`\\rrbracket`),X(`\\lBrace`,"\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),X(`\\rBrace`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),X(`⦃`,`\\lBrace`),X(`⦄`,`\\rBrace`),X(`\\minuso`,"\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),X(`⦵`,`\\minuso`),X(`\\darr`,`\\downarrow`),X(`\\dArr`,`\\Downarrow`),X(`\\Darr`,`\\Downarrow`),X(`\\lang`,`\\langle`),X(`\\rang`,`\\rangle`),X(`\\uarr`,`\\uparrow`),X(`\\uArr`,`\\Uparrow`),X(`\\Uarr`,`\\Uparrow`),X(`\\N`,`\\mathbb{N}`),X(`\\R`,`\\mathbb{R}`),X(`\\Z`,`\\mathbb{Z}`),X(`\\alef`,`\\aleph`),X(`\\alefsym`,`\\aleph`),X(`\\Alpha`,`\\mathrm{A}`),X(`\\Beta`,`\\mathrm{B}`),X(`\\bull`,`\\bullet`),X(`\\Chi`,`\\mathrm{X}`),X(`\\clubs`,`\\clubsuit`),X(`\\cnums`,`\\mathbb{C}`),X(`\\Complex`,`\\mathbb{C}`),X(`\\Dagger`,`\\ddagger`),X(`\\diamonds`,`\\diamondsuit`),X(`\\empty`,`\\emptyset`),X(`\\Epsilon`,`\\mathrm{E}`),X(`\\Eta`,`\\mathrm{H}`),X(`\\exist`,`\\exists`),X(`\\harr`,`\\leftrightarrow`),X(`\\hArr`,`\\Leftrightarrow`),X(`\\Harr`,`\\Leftrightarrow`),X(`\\hearts`,`\\heartsuit`),X(`\\image`,`\\Im`),X(`\\infin`,`\\infty`),X(`\\Iota`,`\\mathrm{I}`),X(`\\isin`,`\\in`),X(`\\Kappa`,`\\mathrm{K}`),X(`\\larr`,`\\leftarrow`),X(`\\lArr`,`\\Leftarrow`),X(`\\Larr`,`\\Leftarrow`),X(`\\lrarr`,`\\leftrightarrow`),X(`\\lrArr`,`\\Leftrightarrow`),X(`\\Lrarr`,`\\Leftrightarrow`),X(`\\Mu`,`\\mathrm{M}`),X(`\\natnums`,`\\mathbb{N}`),X(`\\Nu`,`\\mathrm{N}`),X(`\\Omicron`,`\\mathrm{O}`),X(`\\plusmn`,`\\pm`),X(`\\rarr`,`\\rightarrow`),X(`\\rArr`,`\\Rightarrow`),X(`\\Rarr`,`\\Rightarrow`),X(`\\real`,`\\Re`),X(`\\reals`,`\\mathbb{R}`),X(`\\Reals`,`\\mathbb{R}`),X(`\\Rho`,`\\mathrm{P}`),X(`\\sdot`,`\\cdot`),X(`\\sect`,`\\S`),X(`\\spades`,`\\spadesuit`),X(`\\sub`,`\\subset`),X(`\\sube`,`\\subseteq`),X(`\\supe`,`\\supseteq`),X(`\\Tau`,`\\mathrm{T}`),X(`\\thetasym`,`\\vartheta`),X(`\\weierp`,`\\wp`),X(`\\Zeta`,`\\mathrm{Z}`),X(`\\argmin`,`\\DOTSB\\operatorname*{arg\\,min}`),X(`\\argmax`,`\\DOTSB\\operatorname*{arg\\,max}`),X(`\\plim`,`\\DOTSB\\mathop{\\operatorname{plim}}\\limits`),X(`\\bra`,`\\mathinner{\\langle{#1}|}`),X(`\\ket`,`\\mathinner{|{#1}\\rangle}`),X(`\\braket`,`\\mathinner{\\langle{#1}\\rangle}`),X(`\\Bra`,`\\left\\langle#1\\right|`),X(`\\Ket`,`\\left|#1\\right\\rangle`);var Oh=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.consumeArg().tokens,o=t.macros.get(`|`),s=t.macros.get(`\\|`);t.macros.beginGroup();var c=t=>n=>{e&&(n.macros.set(`|`,o),i.length&&n.macros.set(`\\|`,s));var a=t;return!t&&i.length&&n.future().text===`|`&&(n.popToken(),a=!0),{tokens:a?i:r,numArgs:0}};t.macros.set(`|`,c(!1)),i.length&&t.macros.set(`\\|`,c(!0));var l=t.consumeArg().tokens,u=t.expandTokens([...a,...l,...n]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};X(`\\bra@ket`,Oh(!1)),X(`\\bra@set`,Oh(!0)),X(`\\Braket`,`\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}`),X(`\\Set`,`\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}`),X(`\\set`,`\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}`),X(`\\angln`,`{\\angl n}`),X(`\\blue`,`\\textcolor{##6495ed}{#1}`),X(`\\orange`,`\\textcolor{##ffa500}{#1}`),X(`\\pink`,`\\textcolor{##ff00af}{#1}`),X(`\\red`,`\\textcolor{##df0030}{#1}`),X(`\\green`,`\\textcolor{##28ae7b}{#1}`),X(`\\gray`,`\\textcolor{gray}{#1}`),X(`\\purple`,`\\textcolor{##9d38bd}{#1}`),X(`\\blueA`,`\\textcolor{##ccfaff}{#1}`),X(`\\blueB`,`\\textcolor{##80f6ff}{#1}`),X(`\\blueC`,`\\textcolor{##63d9ea}{#1}`),X(`\\blueD`,`\\textcolor{##11accd}{#1}`),X(`\\blueE`,`\\textcolor{##0c7f99}{#1}`),X(`\\tealA`,`\\textcolor{##94fff5}{#1}`),X(`\\tealB`,`\\textcolor{##26edd5}{#1}`),X(`\\tealC`,`\\textcolor{##01d1c1}{#1}`),X(`\\tealD`,`\\textcolor{##01a995}{#1}`),X(`\\tealE`,`\\textcolor{##208170}{#1}`),X(`\\greenA`,`\\textcolor{##b6ffb0}{#1}`),X(`\\greenB`,`\\textcolor{##8af281}{#1}`),X(`\\greenC`,`\\textcolor{##74cf70}{#1}`),X(`\\greenD`,`\\textcolor{##1fab54}{#1}`),X(`\\greenE`,`\\textcolor{##0d923f}{#1}`),X(`\\goldA`,`\\textcolor{##ffd0a9}{#1}`),X(`\\goldB`,`\\textcolor{##ffbb71}{#1}`),X(`\\goldC`,`\\textcolor{##ff9c39}{#1}`),X(`\\goldD`,`\\textcolor{##e07d10}{#1}`),X(`\\goldE`,`\\textcolor{##a75a05}{#1}`),X(`\\redA`,`\\textcolor{##fca9a9}{#1}`),X(`\\redB`,`\\textcolor{##ff8482}{#1}`),X(`\\redC`,`\\textcolor{##f9685d}{#1}`),X(`\\redD`,`\\textcolor{##e84d39}{#1}`),X(`\\redE`,`\\textcolor{##bc2612}{#1}`),X(`\\maroonA`,`\\textcolor{##ffbde0}{#1}`),X(`\\maroonB`,`\\textcolor{##ff92c6}{#1}`),X(`\\maroonC`,`\\textcolor{##ed5fa6}{#1}`),X(`\\maroonD`,`\\textcolor{##ca337c}{#1}`),X(`\\maroonE`,`\\textcolor{##9e034e}{#1}`),X(`\\purpleA`,`\\textcolor{##ddd7ff}{#1}`),X(`\\purpleB`,`\\textcolor{##c6b9fc}{#1}`),X(`\\purpleC`,`\\textcolor{##aa87ff}{#1}`),X(`\\purpleD`,`\\textcolor{##7854ab}{#1}`),X(`\\purpleE`,`\\textcolor{##543b78}{#1}`),X(`\\mintA`,`\\textcolor{##f5f9e8}{#1}`),X(`\\mintB`,`\\textcolor{##edf2df}{#1}`),X(`\\mintC`,`\\textcolor{##e0e5cc}{#1}`),X(`\\grayA`,`\\textcolor{##f6f7f7}{#1}`),X(`\\grayB`,`\\textcolor{##f0f1f2}{#1}`),X(`\\grayC`,`\\textcolor{##e3e5e6}{#1}`),X(`\\grayD`,`\\textcolor{##d6d8da}{#1}`),X(`\\grayE`,`\\textcolor{##babec2}{#1}`),X(`\\grayF`,`\\textcolor{##888d93}{#1}`),X(`\\grayG`,`\\textcolor{##626569}{#1}`),X(`\\grayH`,`\\textcolor{##3b3e40}{#1}`),X(`\\grayI`,`\\textcolor{##21242c}{#1}`),X(`\\kaBlue`,`\\textcolor{##314453}{#1}`),X(`\\kaGreen`,`\\textcolor{##71B307}{#1}`);var kh={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},Ah=class{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new bh(xh,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new yh(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),this.future().text!==`[`)return null;t=this.popToken(),{tokens:r,end:n}=this.consumeArg([`]`])}else ({tokens:r,start:t,end:n}=this.consumeArg());return this.pushToken(new bm(`EOF`,n.loc)),this.pushTokens(r),new bm(``,ym.range(t,n))}consumeSpaces(){for(;this.future().text===` `;)this.stack.pop()}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text===`{`)++a;else if(i.text===`}`){if(--a,a===-1)throw new N(`Extra }`,i)}else if(i.text===`EOF`)throw new N(`Unexpected end of input in a macro argument, expected '`+(e&&n?e[o]:`}`)+`'`,i);if(e&&n)if((a===0||a===1&&e[o]===`{`)&&i.text===e[o]){if(++o,o===e.length){t.splice(-o,o);break}}else o=0}while(a!==0||n);return r.text===`{`&&t[t.length-1].text===`}`&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:r,end:i}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new N(`The length of delimiters doesn't match the number of args!`);for(var n=t[0],r=0;r<n.length;r++){var i=this.popToken();if(n[r]!==i.text)throw new N(`Use of the macro doesn't match its definition`,i)}}for(var a=[],o=0;o<e;o++)a.push(this.consumeArg(t&&t[o+1]).tokens);return a}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new N(`Too many expansions: infinite loop or need to increase maxExpand setting`)}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(r==null||e&&r.unexpandable){if(e&&r==null&&n[0]===`\\`&&!this.isDefined(n))throw new N(`Undefined control sequence: `+n);return this.pushToken(t),!1}this.countExpansion(1);var i=r.tokens,a=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var s=i[o];if(s.text===`#`){if(o===0)throw new N(`Incomplete placeholder at end of macro body`,s);if(s=i[--o],s.text===`#`)i.splice(o+1,1);else if(/^[1-9]$/.test(s.text))i.splice(o,2,...a[s.text-1]);else throw new N(`Not a valid argument number`,s)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text=`\\relax`),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new bm(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var r=this.stack.pop();r.treatAsRelax&&=(r.noexpand=!1,!1),t.push(r)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(e=>e.text).join(``)}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var r=typeof t==`function`?t(this):t;if(typeof r==`string`){var i=0;if(r.includes(`#`))for(var a=r.replace(/##/g,``);a.includes(`#`+(i+1));)++i;for(var o=new yh(r,this.settings),s=[],c=o.lex();c.text!==`EOF`;)s.push(c),c=o.lex();return s.reverse(),{tokens:s,numArgs:i}}return r}isDefined(e){return this.macros.has(e)||uh.hasOwnProperty(e)||id.math.hasOwnProperty(e)||id.text.hasOwnProperty(e)||kh.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return t==null?uh.hasOwnProperty(e)&&!uh[e].primitive:typeof t==`string`||typeof t==`function`||!t.unexpandable}},jh=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Mh=Object.freeze({"₊":`+`,"₋":`-`,"₌":`=`,"₍":`(`,"₎":`)`,"₀":`0`,"₁":`1`,"₂":`2`,"₃":`3`,"₄":`4`,"₅":`5`,"₆":`6`,"₇":`7`,"₈":`8`,"₉":`9`,ₐ:`a`,ₑ:`e`,ₕ:`h`,ᵢ:`i`,ⱼ:`j`,ₖ:`k`,ₗ:`l`,ₘ:`m`,ₙ:`n`,ₒ:`o`,ₚ:`p`,ᵣ:`r`,ₛ:`s`,ₜ:`t`,ᵤ:`u`,ᵥ:`v`,ₓ:`x`,ᵦ:`β`,ᵧ:`γ`,ᵨ:`ρ`,ᵩ:`ϕ`,ᵪ:`χ`,"⁺":`+`,"⁻":`-`,"⁼":`=`,"⁽":`(`,"⁾":`)`,"⁰":`0`,"¹":`1`,"²":`2`,"³":`3`,"⁴":`4`,"⁵":`5`,"⁶":`6`,"⁷":`7`,"⁸":`8`,"⁹":`9`,ᴬ:`A`,ᴮ:`B`,ᴰ:`D`,ᴱ:`E`,ᴳ:`G`,ᴴ:`H`,ᴵ:`I`,ᴶ:`J`,ᴷ:`K`,ᴸ:`L`,ᴹ:`M`,ᴺ:`N`,ᴼ:`O`,ᴾ:`P`,ᴿ:`R`,ᵀ:`T`,ᵁ:`U`,ⱽ:`V`,ᵂ:`W`,ᵃ:`a`,ᵇ:`b`,ᶜ:`c`,ᵈ:`d`,ᵉ:`e`,ᶠ:`f`,ᵍ:`g`,ʰ:`h`,ⁱ:`i`,ʲ:`j`,ᵏ:`k`,ˡ:`l`,ᵐ:`m`,ⁿ:`n`,ᵒ:`o`,ᵖ:`p`,ʳ:`r`,ˢ:`s`,ᵗ:`t`,ᵘ:`u`,ᵛ:`v`,ʷ:`w`,ˣ:`x`,ʸ:`y`,ᶻ:`z`,ᵝ:`β`,ᵞ:`γ`,ᵟ:`δ`,ᵠ:`ϕ`,ᵡ:`χ`,ᶿ:`θ`}),Nh={"́":{text:`\\'`,math:`\\acute`},"̀":{text:"\\`",math:`\\grave`},"̈":{text:`\\"`,math:`\\ddot`},"̃":{text:`\\~`,math:`\\tilde`},"̄":{text:`\\=`,math:`\\bar`},"̆":{text:`\\u`,math:`\\breve`},"̌":{text:`\\v`,math:`\\check`},"̂":{text:`\\^`,math:`\\hat`},"̇":{text:`\\.`,math:`\\dot`},"̊":{text:`\\r`,math:`\\mathring`},"̋":{text:`\\H`},"̧":{text:`\\c`}},Ph={á:`á`,à:`à`,ä:`ä`,ǟ:`ǟ`,ã:`ã`,ā:`ā`,ă:`ă`,ắ:`ắ`,ằ:`ằ`,ẵ:`ẵ`,ǎ:`ǎ`,â:`â`,ấ:`ấ`,ầ:`ầ`,ẫ:`ẫ`,ȧ:`ȧ`,ǡ:`ǡ`,å:`å`,ǻ:`ǻ`,ḃ:`ḃ`,ć:`ć`,ḉ:`ḉ`,č:`č`,ĉ:`ĉ`,ċ:`ċ`,ç:`ç`,ď:`ď`,ḋ:`ḋ`,ḑ:`ḑ`,é:`é`,è:`è`,ë:`ë`,ẽ:`ẽ`,ē:`ē`,ḗ:`ḗ`,ḕ:`ḕ`,ĕ:`ĕ`,ḝ:`ḝ`,ě:`ě`,ê:`ê`,ế:`ế`,ề:`ề`,ễ:`ễ`,ė:`ė`,ȩ:`ȩ`,ḟ:`ḟ`,ǵ:`ǵ`,ḡ:`ḡ`,ğ:`ğ`,ǧ:`ǧ`,ĝ:`ĝ`,ġ:`ġ`,ģ:`ģ`,ḧ:`ḧ`,ȟ:`ȟ`,ĥ:`ĥ`,ḣ:`ḣ`,ḩ:`ḩ`,í:`í`,ì:`ì`,ï:`ï`,ḯ:`ḯ`,ĩ:`ĩ`,ī:`ī`,ĭ:`ĭ`,ǐ:`ǐ`,î:`î`,ǰ:`ǰ`,ĵ:`ĵ`,ḱ:`ḱ`,ǩ:`ǩ`,ķ:`ķ`,ĺ:`ĺ`,ľ:`ľ`,ļ:`ļ`,ḿ:`ḿ`,ṁ:`ṁ`,ń:`ń`,ǹ:`ǹ`,ñ:`ñ`,ň:`ň`,ṅ:`ṅ`,ņ:`ņ`,ó:`ó`,ò:`ò`,ö:`ö`,ȫ:`ȫ`,õ:`õ`,ṍ:`ṍ`,ṏ:`ṏ`,ȭ:`ȭ`,ō:`ō`,ṓ:`ṓ`,ṑ:`ṑ`,ŏ:`ŏ`,ǒ:`ǒ`,ô:`ô`,ố:`ố`,ồ:`ồ`,ỗ:`ỗ`,ȯ:`ȯ`,ȱ:`ȱ`,ő:`ő`,ṕ:`ṕ`,ṗ:`ṗ`,ŕ:`ŕ`,ř:`ř`,ṙ:`ṙ`,ŗ:`ŗ`,ś:`ś`,ṥ:`ṥ`,š:`š`,ṧ:`ṧ`,ŝ:`ŝ`,ṡ:`ṡ`,ş:`ş`,ẗ:`ẗ`,ť:`ť`,ṫ:`ṫ`,ţ:`ţ`,ú:`ú`,ù:`ù`,ü:`ü`,ǘ:`ǘ`,ǜ:`ǜ`,ǖ:`ǖ`,ǚ:`ǚ`,ũ:`ũ`,ṹ:`ṹ`,ū:`ū`,ṻ:`ṻ`,ŭ:`ŭ`,ǔ:`ǔ`,û:`û`,ů:`ů`,ű:`ű`,ṽ:`ṽ`,ẃ:`ẃ`,ẁ:`ẁ`,ẅ:`ẅ`,ŵ:`ŵ`,ẇ:`ẇ`,ẘ:`ẘ`,ẍ:`ẍ`,ẋ:`ẋ`,ý:`ý`,ỳ:`ỳ`,ÿ:`ÿ`,ỹ:`ỹ`,ȳ:`ȳ`,ŷ:`ŷ`,ẏ:`ẏ`,ẙ:`ẙ`,ź:`ź`,ž:`ž`,ẑ:`ẑ`,ż:`ż`,Á:`Á`,À:`À`,Ä:`Ä`,Ǟ:`Ǟ`,Ã:`Ã`,Ā:`Ā`,Ă:`Ă`,Ắ:`Ắ`,Ằ:`Ằ`,Ẵ:`Ẵ`,Ǎ:`Ǎ`,Â:`Â`,Ấ:`Ấ`,Ầ:`Ầ`,Ẫ:`Ẫ`,Ȧ:`Ȧ`,Ǡ:`Ǡ`,Å:`Å`,Ǻ:`Ǻ`,Ḃ:`Ḃ`,Ć:`Ć`,Ḉ:`Ḉ`,Č:`Č`,Ĉ:`Ĉ`,Ċ:`Ċ`,Ç:`Ç`,Ď:`Ď`,Ḋ:`Ḋ`,Ḑ:`Ḑ`,É:`É`,È:`È`,Ë:`Ë`,Ẽ:`Ẽ`,Ē:`Ē`,Ḗ:`Ḗ`,Ḕ:`Ḕ`,Ĕ:`Ĕ`,Ḝ:`Ḝ`,Ě:`Ě`,Ê:`Ê`,Ế:`Ế`,Ề:`Ề`,Ễ:`Ễ`,Ė:`Ė`,Ȩ:`Ȩ`,Ḟ:`Ḟ`,Ǵ:`Ǵ`,Ḡ:`Ḡ`,Ğ:`Ğ`,Ǧ:`Ǧ`,Ĝ:`Ĝ`,Ġ:`Ġ`,Ģ:`Ģ`,Ḧ:`Ḧ`,Ȟ:`Ȟ`,Ĥ:`Ĥ`,Ḣ:`Ḣ`,Ḩ:`Ḩ`,Í:`Í`,Ì:`Ì`,Ï:`Ï`,Ḯ:`Ḯ`,Ĩ:`Ĩ`,Ī:`Ī`,Ĭ:`Ĭ`,Ǐ:`Ǐ`,Î:`Î`,İ:`İ`,Ĵ:`Ĵ`,Ḱ:`Ḱ`,Ǩ:`Ǩ`,Ķ:`Ķ`,Ĺ:`Ĺ`,Ľ:`Ľ`,Ļ:`Ļ`,Ḿ:`Ḿ`,Ṁ:`Ṁ`,Ń:`Ń`,Ǹ:`Ǹ`,Ñ:`Ñ`,Ň:`Ň`,Ṅ:`Ṅ`,Ņ:`Ņ`,Ó:`Ó`,Ò:`Ò`,Ö:`Ö`,Ȫ:`Ȫ`,Õ:`Õ`,Ṍ:`Ṍ`,Ṏ:`Ṏ`,Ȭ:`Ȭ`,Ō:`Ō`,Ṓ:`Ṓ`,Ṑ:`Ṑ`,Ŏ:`Ŏ`,Ǒ:`Ǒ`,Ô:`Ô`,Ố:`Ố`,Ồ:`Ồ`,Ỗ:`Ỗ`,Ȯ:`Ȯ`,Ȱ:`Ȱ`,Ő:`Ő`,Ṕ:`Ṕ`,Ṗ:`Ṗ`,Ŕ:`Ŕ`,Ř:`Ř`,Ṙ:`Ṙ`,Ŗ:`Ŗ`,Ś:`Ś`,Ṥ:`Ṥ`,Š:`Š`,Ṧ:`Ṧ`,Ŝ:`Ŝ`,Ṡ:`Ṡ`,Ş:`Ş`,Ť:`Ť`,Ṫ:`Ṫ`,Ţ:`Ţ`,Ú:`Ú`,Ù:`Ù`,Ü:`Ü`,Ǘ:`Ǘ`,Ǜ:`Ǜ`,Ǖ:`Ǖ`,Ǚ:`Ǚ`,Ũ:`Ũ`,Ṹ:`Ṹ`,Ū:`Ū`,Ṻ:`Ṻ`,Ŭ:`Ŭ`,Ǔ:`Ǔ`,Û:`Û`,Ů:`Ů`,Ű:`Ű`,Ṽ:`Ṽ`,Ẃ:`Ẃ`,Ẁ:`Ẁ`,Ẅ:`Ẅ`,Ŵ:`Ŵ`,Ẇ:`Ẇ`,Ẍ:`Ẍ`,Ẋ:`Ẋ`,Ý:`Ý`,Ỳ:`Ỳ`,Ÿ:`Ÿ`,Ỹ:`Ỹ`,Ȳ:`Ȳ`,Ŷ:`Ŷ`,Ẏ:`Ẏ`,Ź:`Ź`,Ž:`Ž`,Ẑ:`Ẑ`,Ż:`Ż`,ά:`ά`,ὰ:`ὰ`,ᾱ:`ᾱ`,ᾰ:`ᾰ`,έ:`έ`,ὲ:`ὲ`,ή:`ή`,ὴ:`ὴ`,ί:`ί`,ὶ:`ὶ`,ϊ:`ϊ`,ΐ:`ΐ`,ῒ:`ῒ`,ῑ:`ῑ`,ῐ:`ῐ`,ό:`ό`,ὸ:`ὸ`,ύ:`ύ`,ὺ:`ὺ`,ϋ:`ϋ`,ΰ:`ΰ`,ῢ:`ῢ`,ῡ:`ῡ`,ῠ:`ῠ`,ώ:`ώ`,ὼ:`ὼ`,Ύ:`Ύ`,Ὺ:`Ὺ`,Ϋ:`Ϋ`,Ῡ:`Ῡ`,Ῠ:`Ῠ`,Ώ:`Ώ`,Ὼ:`Ὼ`},Fh=class e{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode=`math`,this.gullet=new Ah(e,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new N(`Expected '`+e+`', got '`+this.fetch().text+`'`,this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken??=this.gullet.expandNextToken(),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set(`\\color`,`\\textcolor`);try{var e=this.parseExpression(!1);return this.expect(`EOF`),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new bm(`}`)),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect(`}`),this.nextToken=t,n}parseExpression(t,n){for(var r=[];;){this.mode===`math`&&this.consumeSpaces();var i=this.fetch();if(e.endOfExpression.has(i.text)||n&&i.text===n||t&&uh[i.text]&&uh[i.text].infix)break;var a=this.parseAtom(n);if(!a)break;a.type!==`internal`&&r.push(a)}return this.mode===`text`&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){for(var t=-1,n,r=0;r<e.length;r++){var i=e[r];if(i.type===`infix`){if(t!==-1)throw new N(`only one infix operator per group`,i.token);t=r,n=i.replaceWith}}if(t!==-1&&n){var a,o,s=e.slice(0,t),c=e.slice(t+1);return a=s.length===1&&s[0].type===`ordgroup`?s[0]:{type:`ordgroup`,mode:this.mode,body:s},o=c.length===1&&c[0].type===`ordgroup`?c[0]:{type:`ordgroup`,mode:this.mode,body:c},[n===`\\\\abovefrac`?this.callFunction(n,[a,e[t],o],[]):this.callFunction(n,[a,o],[])]}else return e}handleSupSubscript(e){var t=this.fetch(),n=t.text;this.consume(),this.consumeSpaces();var r;do r=this.parseGroup(e);while(r?.type===`internal`);if(!r)throw new N(`Expected group after '`+n+`'`,t);return r}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:`textord`,mode:`text`,text:e[n]});var r={type:`text`,mode:this.mode,body:t};return{type:`color`,mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){var t=this.parseGroup(`atom`,e);if(t?.type===`internal`||this.mode===`text`)return t;for(var n,r;;){this.consumeSpaces();var i=this.fetch();if(i.text===`\\limits`||i.text===`\\nolimits`){if(t&&t.type===`op`)t.limits=i.text===`\\limits`,t.alwaysHandleSupSub=!0;else if(t&&t.type===`operatorname`)t.alwaysHandleSupSub&&(t.limits=i.text===`\\limits`);else throw new N(`Limit controls must follow a math operator`,i);this.consume()}else if(i.text===`^`){if(n)throw new N(`Double superscript`,i);n=this.handleSupSubscript(`superscript`)}else if(i.text===`_`){if(r)throw new N(`Double subscript`,i);r=this.handleSupSubscript(`subscript`)}else if(i.text===`'`){if(n)throw new N(`Double superscript`,i);var a={type:`textord`,mode:this.mode,text:`\\prime`},o=[a];for(this.consume();this.fetch().text===`'`;)o.push(a),this.consume();this.fetch().text===`^`&&o.push(this.handleSupSubscript(`superscript`)),n={type:`ordgroup`,mode:this.mode,body:o}}else if(Mh[i.text]){var s=jh.test(i.text),c=[];for(c.push(new bm(Mh[i.text])),this.consume();;){var l=this.fetch().text;if(!Mh[l]||jh.test(l)!==s)break;c.unshift(new bm(Mh[l])),this.consume()}var u=this.subparse(c);s?r={type:`ordgroup`,mode:`math`,body:u}:n={type:`ordgroup`,mode:`math`,body:u}}else break}return n||r?{type:`supsub`,mode:this.mode,base:t,sup:n,sub:r}:t}parseFunction(e,t){var n=this.fetch(),r=n.text,i=uh[r];if(!i)return null;if(this.consume(),t&&t!==`atom`&&!i.allowedInArgument)throw new N(`Got function '`+r+`' with no arguments`+(t?` as `+t:``),n);if(this.mode===`text`&&!i.allowedInText)throw new N(`Can't use function '`+r+`' in text mode`,n);if(this.mode===`math`&&i.allowedInMath===!1)throw new N(`Can't use function '`+r+`' in math mode`,n);var{args:a,optArgs:o}=this.parseArguments(r,i);return this.callFunction(r,a,o,n,e)}callFunction(e,t,n,r,i){var a={funcName:e,parser:this,token:r,breakOnTokenText:i},o=uh[e];if(o&&o.handler)return o.handler(a,t,n);throw new N(`No function handler for `+e)}parseArguments(e,t){var n=t.numArgs+t.numOptionalArgs;if(n===0)return{args:[],optArgs:[]};for(var r=[],i=[],a=0;a<n;a++){var o=t.argTypes&&t.argTypes[a],s=a<t.numOptionalArgs;(`primitive`in t&&t.primitive&&o==null||t.type===`sqrt`&&a===1&&i[0]==null)&&(o=`primitive`);var c=this.parseGroupOfType(`argument to '`+e+`'`,o,s);if(s)i.push(c);else if(c!=null)r.push(c);else throw new N(`Null argument, please report this as a bug`)}return{args:r,optArgs:i}}parseGroupOfType(e,t,n){switch(t){case`color`:return this.parseColorGroup(n);case`size`:return this.parseSizeGroup(n);case`url`:return this.parseUrlGroup(n);case`math`:case`text`:return this.parseArgumentGroup(n,t);case`hbox`:var r=this.parseArgumentGroup(n,`text`);return r==null?null:{type:`styling`,mode:r.mode,body:[r],style:`text`,resetFont:!0};case`raw`:var i=this.parseStringGroup(`raw`,n);return i==null?null:{type:`raw`,mode:`text`,string:i.text};case`primitive`:if(n)throw new N(`A primitive argument cannot be optional`);var a=this.parseGroup(e);if(a==null)throw new N(`Expected group as `+e,this.fetch());return a;case`original`:case null:case void 0:return this.parseArgumentGroup(n);default:throw new N(`Unknown group type as `+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===` `;)this.consume()}parseStringGroup(e,t){var n=this.gullet.scanArgument(t);if(n==null)return null;for(var r=``,i;(i=this.fetch()).text!==`EOF`;)r+=i.text,this.consume();return this.consume(),n.text=r,n}parseRegexGroup(e,t){for(var n=this.fetch(),r=n,i=``,a;(a=this.fetch()).text!==`EOF`&&e.test(i+a.text);)r=a,i+=r.text,this.consume();if(i===``)throw new N(`Invalid `+t+`: '`+n.text+`'`,n);return n.range(r,i)}parseColorGroup(e){var t=this.parseStringGroup(`color`,e);if(t==null)return null;var n=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new N(`Invalid color: '`+t.text+`'`,t);var r=n[0];return/^[0-9a-f]{6}$/i.test(r)&&(r=`#`+r),{type:`color-token`,mode:this.mode,color:r}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),t=!e&&this.gullet.future().text!==`{`?this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,`size`):this.parseStringGroup(`size`,e),!t)return null;!e&&t.text.length===0&&(t.text=`0pt`,n=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new N(`Invalid size: '`+t.text+`'`,t);var i={number:+(r[1]+r[2]),unit:r[3]};if(!Mu(i))throw new N(`Invalid unit: '`+i.unit+`'`,t);return{type:`size`,mode:this.mode,value:i,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode(`%`,13),this.gullet.lexer.setCatcode(`~`,12);var t=this.parseStringGroup(`url`,e);if(this.gullet.lexer.setCatcode(`%`,14),this.gullet.lexer.setCatcode(`~`,13),t==null)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,`$1`);return{type:`url`,mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(n==null)return null;var r=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var i=this.parseExpression(!1,`EOF`);this.expect(`EOF`),this.gullet.endGroup();var a={type:`ordgroup`,mode:this.mode,loc:n.loc,body:i};return t&&this.switchMode(r),a}parseGroup(e,t){var n=this.fetch(),r=n.text,i;if(r===`{`||r===`\\begingroup`){this.consume();var a=r===`{`?`}`:`\\endgroup`;this.gullet.beginGroup();var o=this.parseExpression(!1,a),s=this.fetch();this.expect(a),this.gullet.endGroup(),i={type:`ordgroup`,mode:this.mode,loc:ym.range(n,s),body:o,semisimple:r===`\\begingroup`||void 0}}else if(i=this.parseFunction(t,e)||this.parseSymbol(),i==null&&r[0]===`\\`&&!kh.hasOwnProperty(r)){if(this.settings.throwOnError)throw new N(`Undefined control sequence: `+r,n);i=this.formatUnsupportedCmd(r),this.consume()}return i}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var r=e[n];if(r.type===`textord`){var i=r.text,a=e[n+1];if(!(!a||a.type!==`textord`)){if(i===`-`&&a.text===`-`){var o=e[n+2];n+1<t&&o&&o.type===`textord`&&o.text===`-`?(e.splice(n,3,{type:`textord`,mode:`text`,loc:ym.range(r,o),text:`---`}),t-=2):(e.splice(n,2,{type:`textord`,mode:`text`,loc:ym.range(r,a),text:`--`}),--t)}(i===`'`||i==="`")&&a.text===i&&(e.splice(n,2,{type:`textord`,mode:`text`,loc:ym.range(r,a),text:i+i}),--t)}}}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r=n.charAt(0)===`*`;if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new N(`\\verb assertion failed --
|
|
301
|
-
please report what input caused this bug`);return n=n.slice(1,-1),{type:`verb`,mode:`text`,body:n,star:r}}
|
|
351
|
+
?)[ \r ]*`,pU=`[̀-ͯ]`,mU=RegExp(pU+`+$`),hU=`(`+cU+`+)|`+(fU+`|`)+`([!-\\[\\]-‧-豈-]`+(pU+`*`)+`|[\ud800-\udbff][\udc00-\udfff]`+(pU+`*`)+`|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5`+(`|`+dU)+(`|`+uU+`)`),gU=class{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(hU,`g`),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new _H(`EOF`,new gH(this,t,t));var n=this.tokenRegex.exec(e);if(n===null||n.index!==t)throw new L(`Unexpected character: '`+e[t]+`'`,new _H(e[t],new gH(this,t,t+1)));var r=n[6]||n[3]||(n[2]?`\\ `:` `);if(this.catcodes[r]===14){var i=e.indexOf(`
|
|
352
|
+
`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict(`commentAtEnd`,`% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)`)):this.tokenRegex.lastIndex=i+1,this.lex()}return new _H(r,new gH(this,t,this.tokenRegex.lastIndex))}},_U=class{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new L(`Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug`);var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(e[t]==null?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(n===void 0&&(n=!1),n){for(var r=0;r<this.undefStack.length;r++)delete this.undefStack[r][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(e)&&(i[e]=this.current[e])}t==null?delete this.current[e]:this.current[e]=t}},vU=hH;Z(`\\noexpand`,function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),Z(`\\expandafter`,function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),Z(`\\@firstoftwo`,function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),Z(`\\@secondoftwo`,function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),Z(`\\@ifnextchar`,function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),Z(`\\@ifstar`,`\\@ifnextchar *{\\@firstoftwo{#1}}`),Z(`\\TextOrMath`,function(e){var t=e.consumeArgs(2);return e.mode===`text`?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var yU={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Z(`\\char`,function(e){var t=e.popToken(),n,r=0;if(t.text===`'`)n=8,t=e.popToken();else if(t.text===`"`)n=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]===`\\`)r=t.text.charCodeAt(1);else if(t.text===`EOF`)throw new L("\\char` missing argument");else r=t.text.charCodeAt(0);else n=10;if(n){if(r=yU[t.text],r==null||r>=n)throw new L(`Invalid base-`+n+` digit `+t.text);for(var i;(i=yU[e.future().text])!=null&&i<n;)r*=n,r+=i,e.popToken()}return`\\@char{`+r+`}`});var bU=(e,t,n,r)=>{var i=e.consumeArg().tokens;if(i.length!==1)throw new L(`\\newcommand's first argument must be a macro name`);var a=i[0].text,o=e.isDefined(a);if(o&&!t)throw new L(`\\newcommand{`+a+`} attempting to redefine `+(a+`; use \\renewcommand`));if(!o&&!n)throw new L(`\\renewcommand{`+a+`} when command `+a+` does not yet exist; use \\newcommand`);var s=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text===`[`){for(var c=``,l=e.expandNextToken();l.text!==`]`&&l.text!==`EOF`;)c+=l.text,l=e.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new L(`Invalid number of arguments: `+c);s=parseInt(c),i=e.consumeArg().tokens}return o&&r||e.macros.set(a,{tokens:i,numArgs:s}),``};Z(`\\newcommand`,e=>bU(e,!1,!0,!1)),Z(`\\renewcommand`,e=>bU(e,!0,!1,!1)),Z(`\\providecommand`,e=>bU(e,!0,!0,!0)),Z(`\\message`,e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join(``)),``}),Z(`\\errmessage`,e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join(``)),``}),Z(`\\show`,e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),sU[n],ez.math[n],ez.text[n]),``}),Z(`\\bgroup`,`{`),Z(`\\egroup`,`}`),Z(`~`,`\\nobreakspace`),Z(`\\lq`,"`"),Z(`\\rq`,`'`),Z(`\\aa`,`\\r a`),Z(`\\AA`,`\\r A`),Z(`\\textcopyright`,"\\html@mathml{\\textcircled{c}}{\\char`©}"),Z(`\\copyright`,`\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}`),Z(`\\textregistered`,"\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),Z(`ℬ`,`\\mathscr{B}`),Z(`ℰ`,`\\mathscr{E}`),Z(`ℱ`,`\\mathscr{F}`),Z(`ℋ`,`\\mathscr{H}`),Z(`ℐ`,`\\mathscr{I}`),Z(`ℒ`,`\\mathscr{L}`),Z(`ℳ`,`\\mathscr{M}`),Z(`ℛ`,`\\mathscr{R}`),Z(`ℭ`,`\\mathfrak{C}`),Z(`ℌ`,`\\mathfrak{H}`),Z(`ℨ`,`\\mathfrak{Z}`),Z(`\\Bbbk`,`\\Bbb{k}`),Z(`\\llap`,`\\mathllap{\\textrm{#1}}`),Z(`\\rlap`,`\\mathrlap{\\textrm{#1}}`),Z(`\\clap`,`\\mathclap{\\textrm{#1}}`),Z(`\\mathstrut`,`\\vphantom{(}`),Z(`\\underbar`,`\\underline{\\text{#1}}`),Z(`\\not`,`\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}`),Z(`\\neq`,"\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),Z(`\\ne`,`\\neq`),Z(`≠`,`\\neq`),Z(`\\notin`,"\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),Z(`∉`,`\\notin`),Z(`≘`,"\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),Z(`≙`,"\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),Z(`≚`,"\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),Z(`≛`,"\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),Z(`≝`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),Z(`≞`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),Z(`≟`,"\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),Z(`⟂`,`\\perp`),Z(`‼`,`\\mathclose{!\\mkern-0.8mu!}`),Z(`∌`,`\\notni`),Z(`⌜`,`\\ulcorner`),Z(`⌝`,`\\urcorner`),Z(`⌞`,`\\llcorner`),Z(`⌟`,`\\lrcorner`),Z(`©`,`\\copyright`),Z(`®`,`\\textregistered`),Z(`\\ulcorner`,`\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}`),Z(`\\urcorner`,`\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}`),Z(`\\llcorner`,`\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}`),Z(`\\lrcorner`,`\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}`),Z(`\\vdots`,`{\\varvdots\\rule{0pt}{15pt}}`),Z(`⋮`,`\\vdots`),Z(`\\varGamma`,`\\mathit{\\Gamma}`),Z(`\\varDelta`,`\\mathit{\\Delta}`),Z(`\\varTheta`,`\\mathit{\\Theta}`),Z(`\\varLambda`,`\\mathit{\\Lambda}`),Z(`\\varXi`,`\\mathit{\\Xi}`),Z(`\\varPi`,`\\mathit{\\Pi}`),Z(`\\varSigma`,`\\mathit{\\Sigma}`),Z(`\\varUpsilon`,`\\mathit{\\Upsilon}`),Z(`\\varPhi`,`\\mathit{\\Phi}`),Z(`\\varPsi`,`\\mathit{\\Psi}`),Z(`\\varOmega`,`\\mathit{\\Omega}`),Z(`\\substack`,`\\begin{subarray}{c}#1\\end{subarray}`),Z(`\\colon`,`\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax`),Z(`\\boxed`,`\\fbox{$\\displaystyle{#1}$}`),Z(`\\iff`,`\\DOTSB\\;\\Longleftrightarrow\\;`),Z(`\\implies`,`\\DOTSB\\;\\Longrightarrow\\;`),Z(`\\impliedby`,`\\DOTSB\\;\\Longleftarrow\\;`),Z(`\\dddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}`),Z(`\\ddddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}`);var xU={",":`\\dotsc`,"\\not":`\\dotsb`,"+":`\\dotsb`,"=":`\\dotsb`,"<":`\\dotsb`,">":`\\dotsb`,"-":`\\dotsb`,"*":`\\dotsb`,":":`\\dotsb`,"\\DOTSB":`\\dotsb`,"\\coprod":`\\dotsb`,"\\bigvee":`\\dotsb`,"\\bigwedge":`\\dotsb`,"\\biguplus":`\\dotsb`,"\\bigcap":`\\dotsb`,"\\bigcup":`\\dotsb`,"\\prod":`\\dotsb`,"\\sum":`\\dotsb`,"\\bigotimes":`\\dotsb`,"\\bigoplus":`\\dotsb`,"\\bigodot":`\\dotsb`,"\\bigsqcup":`\\dotsb`,"\\And":`\\dotsb`,"\\longrightarrow":`\\dotsb`,"\\Longrightarrow":`\\dotsb`,"\\longleftarrow":`\\dotsb`,"\\Longleftarrow":`\\dotsb`,"\\longleftrightarrow":`\\dotsb`,"\\Longleftrightarrow":`\\dotsb`,"\\mapsto":`\\dotsb`,"\\longmapsto":`\\dotsb`,"\\hookrightarrow":`\\dotsb`,"\\doteq":`\\dotsb`,"\\mathbin":`\\dotsb`,"\\mathrel":`\\dotsb`,"\\relbar":`\\dotsb`,"\\Relbar":`\\dotsb`,"\\xrightarrow":`\\dotsb`,"\\xleftarrow":`\\dotsb`,"\\DOTSI":`\\dotsi`,"\\int":`\\dotsi`,"\\oint":`\\dotsi`,"\\iint":`\\dotsi`,"\\iiint":`\\dotsi`,"\\iiiint":`\\dotsi`,"\\idotsint":`\\dotsi`,"\\DOTSX":`\\dotsx`},SU=new Set([`bin`,`rel`]);Z(`\\dots`,function(e){var t=`\\dotso`,n=e.expandAfterFuture().text;return n in xU?t=xU[n]:(n.slice(0,4)===`\\not`||n in ez.math&&SU.has(ez.math[n].group))&&(t=`\\dotsb`),t});var CU={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};Z(`\\dotso`,function(e){return e.future().text in CU?`\\ldots\\,`:`\\ldots`}),Z(`\\dotsc`,function(e){var t=e.future().text;return t in CU&&t!==`,`?`\\ldots\\,`:`\\ldots`}),Z(`\\cdots`,function(e){return e.future().text in CU?`\\@cdots\\,`:`\\@cdots`}),Z(`\\dotsb`,`\\cdots`),Z(`\\dotsm`,`\\cdots`),Z(`\\dotsi`,`\\!\\cdots`),Z(`\\dotsx`,`\\ldots\\,`),Z(`\\DOTSI`,`\\relax`),Z(`\\DOTSB`,`\\relax`),Z(`\\DOTSX`,`\\relax`),Z(`\\tmspace`,`\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax`),Z(`\\,`,`\\tmspace+{3mu}{.1667em}`),Z(`\\thinspace`,`\\,`),Z(`\\>`,`\\mskip{4mu}`),Z(`\\:`,`\\tmspace+{4mu}{.2222em}`),Z(`\\medspace`,`\\:`),Z(`\\;`,`\\tmspace+{5mu}{.2777em}`),Z(`\\thickspace`,`\\;`),Z(`\\!`,`\\tmspace-{3mu}{.1667em}`),Z(`\\negthinspace`,`\\!`),Z(`\\negmedspace`,`\\tmspace-{4mu}{.2222em}`),Z(`\\negthickspace`,`\\tmspace-{5mu}{.277em}`),Z(`\\enspace`,`\\kern.5em `),Z(`\\enskip`,`\\hskip.5em\\relax`),Z(`\\quad`,`\\hskip1em\\relax`),Z(`\\qquad`,`\\hskip2em\\relax`),Z(`\\tag`,`\\@ifstar\\tag@literal\\tag@paren`),Z(`\\tag@paren`,`\\tag@literal{({#1})}`),Z(`\\tag@literal`,e=>{if(e.macros.get(`\\df@tag`))throw new L(`Multiple \\tag`);return`\\gdef\\df@tag{\\text{#1}}`}),Z(`\\bmod`,`\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}`),Z(`\\pod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)`),Z(`\\pmod`,`\\pod{{\\rm mod}\\mkern6mu#1}`),Z(`\\mod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1`),Z(`\\newline`,`\\\\\\relax`),Z(`\\TeX`,`\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}`);var wU=R(qR[`Main-Regular`][84][1]-.7*qR[`Main-Regular`][65][1]);Z(`\\LaTeX`,`\\textrm{\\html@mathml{`+(`L\\kern-.36em\\raisebox{`+wU+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{LaTeX}}`),Z(`\\KaTeX`,`\\textrm{\\html@mathml{`+(`K\\kern-.17em\\raisebox{`+wU+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{KaTeX}}`),Z(`\\hspace`,`\\@ifstar\\@hspacer\\@hspace`),Z(`\\@hspace`,`\\hskip #1\\relax`),Z(`\\@hspacer`,`\\rule{0pt}{0pt}\\hskip #1\\relax`),Z(`\\ordinarycolon`,`:`),Z(`\\vcentcolon`,`\\mathrel{\\mathop\\ordinarycolon}`),Z(`\\dblcolon`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}`),Z(`\\coloneqq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}`),Z(`\\Coloneqq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}`),Z(`\\coloneq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}`),Z(`\\Coloneq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}`),Z(`\\eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}`),Z(`\\Eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}`),Z(`\\eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}`),Z(`\\Eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}`),Z(`\\colonapprox`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}`),Z(`\\Colonapprox`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}`),Z(`\\colonsim`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}`),Z(`\\Colonsim`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}`),Z(`∷`,`\\dblcolon`),Z(`∹`,`\\eqcolon`),Z(`≔`,`\\coloneqq`),Z(`≕`,`\\eqqcolon`),Z(`⩴`,`\\Coloneqq`),Z(`\\ratio`,`\\vcentcolon`),Z(`\\coloncolon`,`\\dblcolon`),Z(`\\colonequals`,`\\coloneqq`),Z(`\\coloncolonequals`,`\\Coloneqq`),Z(`\\equalscolon`,`\\eqqcolon`),Z(`\\equalscoloncolon`,`\\Eqqcolon`),Z(`\\colonminus`,`\\coloneq`),Z(`\\coloncolonminus`,`\\Coloneq`),Z(`\\minuscolon`,`\\eqcolon`),Z(`\\minuscoloncolon`,`\\Eqcolon`),Z(`\\coloncolonapprox`,`\\Colonapprox`),Z(`\\coloncolonsim`,`\\Colonsim`),Z(`\\simcolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),Z(`\\simcoloncolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}`),Z(`\\approxcolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),Z(`\\approxcoloncolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}`),Z(`\\notni`,"\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),Z(`\\limsup`,`\\DOTSB\\operatorname*{lim\\,sup}`),Z(`\\liminf`,`\\DOTSB\\operatorname*{lim\\,inf}`),Z(`\\injlim`,`\\DOTSB\\operatorname*{inj\\,lim}`),Z(`\\projlim`,`\\DOTSB\\operatorname*{proj\\,lim}`),Z(`\\varlimsup`,`\\DOTSB\\operatorname*{\\overline{lim}}`),Z(`\\varliminf`,`\\DOTSB\\operatorname*{\\underline{lim}}`),Z(`\\varinjlim`,`\\DOTSB\\operatorname*{\\underrightarrow{lim}}`),Z(`\\varprojlim`,`\\DOTSB\\operatorname*{\\underleftarrow{lim}}`),Z(`\\gvertneqq`,`\\html@mathml{\\@gvertneqq}{≩}`),Z(`\\lvertneqq`,`\\html@mathml{\\@lvertneqq}{≨}`),Z(`\\ngeqq`,`\\html@mathml{\\@ngeqq}{≱}`),Z(`\\ngeqslant`,`\\html@mathml{\\@ngeqslant}{≱}`),Z(`\\nleqq`,`\\html@mathml{\\@nleqq}{≰}`),Z(`\\nleqslant`,`\\html@mathml{\\@nleqslant}{≰}`),Z(`\\nshortmid`,`\\html@mathml{\\@nshortmid}{∤}`),Z(`\\nshortparallel`,`\\html@mathml{\\@nshortparallel}{∦}`),Z(`\\nsubseteqq`,`\\html@mathml{\\@nsubseteqq}{⊈}`),Z(`\\nsupseteqq`,`\\html@mathml{\\@nsupseteqq}{⊉}`),Z(`\\varsubsetneq`,`\\html@mathml{\\@varsubsetneq}{⊊}`),Z(`\\varsubsetneqq`,`\\html@mathml{\\@varsubsetneqq}{⫋}`),Z(`\\varsupsetneq`,`\\html@mathml{\\@varsupsetneq}{⊋}`),Z(`\\varsupsetneqq`,`\\html@mathml{\\@varsupsetneqq}{⫌}`),Z(`\\imath`,`\\html@mathml{\\@imath}{ı}`),Z(`\\jmath`,`\\html@mathml{\\@jmath}{ȷ}`),Z(`\\llbracket`,"\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),Z(`\\rrbracket`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),Z(`⟦`,`\\llbracket`),Z(`⟧`,`\\rrbracket`),Z(`\\lBrace`,"\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),Z(`\\rBrace`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),Z(`⦃`,`\\lBrace`),Z(`⦄`,`\\rBrace`),Z(`\\minuso`,"\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),Z(`⦵`,`\\minuso`),Z(`\\darr`,`\\downarrow`),Z(`\\dArr`,`\\Downarrow`),Z(`\\Darr`,`\\Downarrow`),Z(`\\lang`,`\\langle`),Z(`\\rang`,`\\rangle`),Z(`\\uarr`,`\\uparrow`),Z(`\\uArr`,`\\Uparrow`),Z(`\\Uarr`,`\\Uparrow`),Z(`\\N`,`\\mathbb{N}`),Z(`\\R`,`\\mathbb{R}`),Z(`\\Z`,`\\mathbb{Z}`),Z(`\\alef`,`\\aleph`),Z(`\\alefsym`,`\\aleph`),Z(`\\Alpha`,`\\mathrm{A}`),Z(`\\Beta`,`\\mathrm{B}`),Z(`\\bull`,`\\bullet`),Z(`\\Chi`,`\\mathrm{X}`),Z(`\\clubs`,`\\clubsuit`),Z(`\\cnums`,`\\mathbb{C}`),Z(`\\Complex`,`\\mathbb{C}`),Z(`\\Dagger`,`\\ddagger`),Z(`\\diamonds`,`\\diamondsuit`),Z(`\\empty`,`\\emptyset`),Z(`\\Epsilon`,`\\mathrm{E}`),Z(`\\Eta`,`\\mathrm{H}`),Z(`\\exist`,`\\exists`),Z(`\\harr`,`\\leftrightarrow`),Z(`\\hArr`,`\\Leftrightarrow`),Z(`\\Harr`,`\\Leftrightarrow`),Z(`\\hearts`,`\\heartsuit`),Z(`\\image`,`\\Im`),Z(`\\infin`,`\\infty`),Z(`\\Iota`,`\\mathrm{I}`),Z(`\\isin`,`\\in`),Z(`\\Kappa`,`\\mathrm{K}`),Z(`\\larr`,`\\leftarrow`),Z(`\\lArr`,`\\Leftarrow`),Z(`\\Larr`,`\\Leftarrow`),Z(`\\lrarr`,`\\leftrightarrow`),Z(`\\lrArr`,`\\Leftrightarrow`),Z(`\\Lrarr`,`\\Leftrightarrow`),Z(`\\Mu`,`\\mathrm{M}`),Z(`\\natnums`,`\\mathbb{N}`),Z(`\\Nu`,`\\mathrm{N}`),Z(`\\Omicron`,`\\mathrm{O}`),Z(`\\plusmn`,`\\pm`),Z(`\\rarr`,`\\rightarrow`),Z(`\\rArr`,`\\Rightarrow`),Z(`\\Rarr`,`\\Rightarrow`),Z(`\\real`,`\\Re`),Z(`\\reals`,`\\mathbb{R}`),Z(`\\Reals`,`\\mathbb{R}`),Z(`\\Rho`,`\\mathrm{P}`),Z(`\\sdot`,`\\cdot`),Z(`\\sect`,`\\S`),Z(`\\spades`,`\\spadesuit`),Z(`\\sub`,`\\subset`),Z(`\\sube`,`\\subseteq`),Z(`\\supe`,`\\supseteq`),Z(`\\Tau`,`\\mathrm{T}`),Z(`\\thetasym`,`\\vartheta`),Z(`\\weierp`,`\\wp`),Z(`\\Zeta`,`\\mathrm{Z}`),Z(`\\argmin`,`\\DOTSB\\operatorname*{arg\\,min}`),Z(`\\argmax`,`\\DOTSB\\operatorname*{arg\\,max}`),Z(`\\plim`,`\\DOTSB\\mathop{\\operatorname{plim}}\\limits`),Z(`\\bra`,`\\mathinner{\\langle{#1}|}`),Z(`\\ket`,`\\mathinner{|{#1}\\rangle}`),Z(`\\braket`,`\\mathinner{\\langle{#1}\\rangle}`),Z(`\\Bra`,`\\left\\langle#1\\right|`),Z(`\\Ket`,`\\left|#1\\right\\rangle`);var TU=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.consumeArg().tokens,o=t.macros.get(`|`),s=t.macros.get(`\\|`);t.macros.beginGroup();var c=t=>n=>{e&&(n.macros.set(`|`,o),i.length&&n.macros.set(`\\|`,s));var a=t;return!t&&i.length&&n.future().text===`|`&&(n.popToken(),a=!0),{tokens:a?i:r,numArgs:0}};t.macros.set(`|`,c(!1)),i.length&&t.macros.set(`\\|`,c(!0));var l=t.consumeArg().tokens,u=t.expandTokens([...a,...l,...n]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};Z(`\\bra@ket`,TU(!1)),Z(`\\bra@set`,TU(!0)),Z(`\\Braket`,`\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}`),Z(`\\Set`,`\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}`),Z(`\\set`,`\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}`),Z(`\\angln`,`{\\angl n}`),Z(`\\blue`,`\\textcolor{##6495ed}{#1}`),Z(`\\orange`,`\\textcolor{##ffa500}{#1}`),Z(`\\pink`,`\\textcolor{##ff00af}{#1}`),Z(`\\red`,`\\textcolor{##df0030}{#1}`),Z(`\\green`,`\\textcolor{##28ae7b}{#1}`),Z(`\\gray`,`\\textcolor{gray}{#1}`),Z(`\\purple`,`\\textcolor{##9d38bd}{#1}`),Z(`\\blueA`,`\\textcolor{##ccfaff}{#1}`),Z(`\\blueB`,`\\textcolor{##80f6ff}{#1}`),Z(`\\blueC`,`\\textcolor{##63d9ea}{#1}`),Z(`\\blueD`,`\\textcolor{##11accd}{#1}`),Z(`\\blueE`,`\\textcolor{##0c7f99}{#1}`),Z(`\\tealA`,`\\textcolor{##94fff5}{#1}`),Z(`\\tealB`,`\\textcolor{##26edd5}{#1}`),Z(`\\tealC`,`\\textcolor{##01d1c1}{#1}`),Z(`\\tealD`,`\\textcolor{##01a995}{#1}`),Z(`\\tealE`,`\\textcolor{##208170}{#1}`),Z(`\\greenA`,`\\textcolor{##b6ffb0}{#1}`),Z(`\\greenB`,`\\textcolor{##8af281}{#1}`),Z(`\\greenC`,`\\textcolor{##74cf70}{#1}`),Z(`\\greenD`,`\\textcolor{##1fab54}{#1}`),Z(`\\greenE`,`\\textcolor{##0d923f}{#1}`),Z(`\\goldA`,`\\textcolor{##ffd0a9}{#1}`),Z(`\\goldB`,`\\textcolor{##ffbb71}{#1}`),Z(`\\goldC`,`\\textcolor{##ff9c39}{#1}`),Z(`\\goldD`,`\\textcolor{##e07d10}{#1}`),Z(`\\goldE`,`\\textcolor{##a75a05}{#1}`),Z(`\\redA`,`\\textcolor{##fca9a9}{#1}`),Z(`\\redB`,`\\textcolor{##ff8482}{#1}`),Z(`\\redC`,`\\textcolor{##f9685d}{#1}`),Z(`\\redD`,`\\textcolor{##e84d39}{#1}`),Z(`\\redE`,`\\textcolor{##bc2612}{#1}`),Z(`\\maroonA`,`\\textcolor{##ffbde0}{#1}`),Z(`\\maroonB`,`\\textcolor{##ff92c6}{#1}`),Z(`\\maroonC`,`\\textcolor{##ed5fa6}{#1}`),Z(`\\maroonD`,`\\textcolor{##ca337c}{#1}`),Z(`\\maroonE`,`\\textcolor{##9e034e}{#1}`),Z(`\\purpleA`,`\\textcolor{##ddd7ff}{#1}`),Z(`\\purpleB`,`\\textcolor{##c6b9fc}{#1}`),Z(`\\purpleC`,`\\textcolor{##aa87ff}{#1}`),Z(`\\purpleD`,`\\textcolor{##7854ab}{#1}`),Z(`\\purpleE`,`\\textcolor{##543b78}{#1}`),Z(`\\mintA`,`\\textcolor{##f5f9e8}{#1}`),Z(`\\mintB`,`\\textcolor{##edf2df}{#1}`),Z(`\\mintC`,`\\textcolor{##e0e5cc}{#1}`),Z(`\\grayA`,`\\textcolor{##f6f7f7}{#1}`),Z(`\\grayB`,`\\textcolor{##f0f1f2}{#1}`),Z(`\\grayC`,`\\textcolor{##e3e5e6}{#1}`),Z(`\\grayD`,`\\textcolor{##d6d8da}{#1}`),Z(`\\grayE`,`\\textcolor{##babec2}{#1}`),Z(`\\grayF`,`\\textcolor{##888d93}{#1}`),Z(`\\grayG`,`\\textcolor{##626569}{#1}`),Z(`\\grayH`,`\\textcolor{##3b3e40}{#1}`),Z(`\\grayI`,`\\textcolor{##21242c}{#1}`),Z(`\\kaBlue`,`\\textcolor{##314453}{#1}`),Z(`\\kaGreen`,`\\textcolor{##71B307}{#1}`);var EU={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},DU=class{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new _U(vU,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new gU(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),this.future().text!==`[`)return null;t=this.popToken(),{tokens:r,end:n}=this.consumeArg([`]`])}else ({tokens:r,start:t,end:n}=this.consumeArg());return this.pushToken(new _H(`EOF`,n.loc)),this.pushTokens(r),new _H(``,gH.range(t,n))}consumeSpaces(){for(;this.future().text===` `;)this.stack.pop()}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text===`{`)++a;else if(i.text===`}`){if(--a,a===-1)throw new L(`Extra }`,i)}else if(i.text===`EOF`)throw new L(`Unexpected end of input in a macro argument, expected '`+(e&&n?e[o]:`}`)+`'`,i);if(e&&n)if((a===0||a===1&&e[o]===`{`)&&i.text===e[o]){if(++o,o===e.length){t.splice(-o,o);break}}else o=0}while(a!==0||n);return r.text===`{`&&t[t.length-1].text===`}`&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:r,end:i}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new L(`The length of delimiters doesn't match the number of args!`);for(var n=t[0],r=0;r<n.length;r++){var i=this.popToken();if(n[r]!==i.text)throw new L(`Use of the macro doesn't match its definition`,i)}}for(var a=[],o=0;o<e;o++)a.push(this.consumeArg(t&&t[o+1]).tokens);return a}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new L(`Too many expansions: infinite loop or need to increase maxExpand setting`)}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(r==null||e&&r.unexpandable){if(e&&r==null&&n[0]===`\\`&&!this.isDefined(n))throw new L(`Undefined control sequence: `+n);return this.pushToken(t),!1}this.countExpansion(1);var i=r.tokens,a=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var s=i[o];if(s.text===`#`){if(o===0)throw new L(`Incomplete placeholder at end of macro body`,s);if(s=i[--o],s.text===`#`)i.splice(o+1,1);else if(/^[1-9]$/.test(s.text))i.splice(o,2,...a[s.text-1]);else throw new L(`Not a valid argument number`,s)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text=`\\relax`),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new _H(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var r=this.stack.pop();r.treatAsRelax&&=(r.noexpand=!1,!1),t.push(r)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(e=>e.text).join(``)}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var r=typeof t==`function`?t(this):t;if(typeof r==`string`){var i=0;if(r.includes(`#`))for(var a=r.replace(/##/g,``);a.includes(`#`+(i+1));)++i;for(var o=new gU(r,this.settings),s=[],c=o.lex();c.text!==`EOF`;)s.push(c),c=o.lex();return s.reverse(),{tokens:s,numArgs:i}}return r}isDefined(e){return this.macros.has(e)||sU.hasOwnProperty(e)||ez.math.hasOwnProperty(e)||ez.text.hasOwnProperty(e)||EU.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return t==null?sU.hasOwnProperty(e)&&!sU[e].primitive:typeof t==`string`||typeof t==`function`||!t.unexpandable}},OU=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,kU=Object.freeze({"₊":`+`,"₋":`-`,"₌":`=`,"₍":`(`,"₎":`)`,"₀":`0`,"₁":`1`,"₂":`2`,"₃":`3`,"₄":`4`,"₅":`5`,"₆":`6`,"₇":`7`,"₈":`8`,"₉":`9`,ₐ:`a`,ₑ:`e`,ₕ:`h`,ᵢ:`i`,ⱼ:`j`,ₖ:`k`,ₗ:`l`,ₘ:`m`,ₙ:`n`,ₒ:`o`,ₚ:`p`,ᵣ:`r`,ₛ:`s`,ₜ:`t`,ᵤ:`u`,ᵥ:`v`,ₓ:`x`,ᵦ:`β`,ᵧ:`γ`,ᵨ:`ρ`,ᵩ:`ϕ`,ᵪ:`χ`,"⁺":`+`,"⁻":`-`,"⁼":`=`,"⁽":`(`,"⁾":`)`,"⁰":`0`,"¹":`1`,"²":`2`,"³":`3`,"⁴":`4`,"⁵":`5`,"⁶":`6`,"⁷":`7`,"⁸":`8`,"⁹":`9`,ᴬ:`A`,ᴮ:`B`,ᴰ:`D`,ᴱ:`E`,ᴳ:`G`,ᴴ:`H`,ᴵ:`I`,ᴶ:`J`,ᴷ:`K`,ᴸ:`L`,ᴹ:`M`,ᴺ:`N`,ᴼ:`O`,ᴾ:`P`,ᴿ:`R`,ᵀ:`T`,ᵁ:`U`,ⱽ:`V`,ᵂ:`W`,ᵃ:`a`,ᵇ:`b`,ᶜ:`c`,ᵈ:`d`,ᵉ:`e`,ᶠ:`f`,ᵍ:`g`,ʰ:`h`,ⁱ:`i`,ʲ:`j`,ᵏ:`k`,ˡ:`l`,ᵐ:`m`,ⁿ:`n`,ᵒ:`o`,ᵖ:`p`,ʳ:`r`,ˢ:`s`,ᵗ:`t`,ᵘ:`u`,ᵛ:`v`,ʷ:`w`,ˣ:`x`,ʸ:`y`,ᶻ:`z`,ᵝ:`β`,ᵞ:`γ`,ᵟ:`δ`,ᵠ:`ϕ`,ᵡ:`χ`,ᶿ:`θ`}),AU={"́":{text:`\\'`,math:`\\acute`},"̀":{text:"\\`",math:`\\grave`},"̈":{text:`\\"`,math:`\\ddot`},"̃":{text:`\\~`,math:`\\tilde`},"̄":{text:`\\=`,math:`\\bar`},"̆":{text:`\\u`,math:`\\breve`},"̌":{text:`\\v`,math:`\\check`},"̂":{text:`\\^`,math:`\\hat`},"̇":{text:`\\.`,math:`\\dot`},"̊":{text:`\\r`,math:`\\mathring`},"̋":{text:`\\H`},"̧":{text:`\\c`}},jU={á:`á`,à:`à`,ä:`ä`,ǟ:`ǟ`,ã:`ã`,ā:`ā`,ă:`ă`,ắ:`ắ`,ằ:`ằ`,ẵ:`ẵ`,ǎ:`ǎ`,â:`â`,ấ:`ấ`,ầ:`ầ`,ẫ:`ẫ`,ȧ:`ȧ`,ǡ:`ǡ`,å:`å`,ǻ:`ǻ`,ḃ:`ḃ`,ć:`ć`,ḉ:`ḉ`,č:`č`,ĉ:`ĉ`,ċ:`ċ`,ç:`ç`,ď:`ď`,ḋ:`ḋ`,ḑ:`ḑ`,é:`é`,è:`è`,ë:`ë`,ẽ:`ẽ`,ē:`ē`,ḗ:`ḗ`,ḕ:`ḕ`,ĕ:`ĕ`,ḝ:`ḝ`,ě:`ě`,ê:`ê`,ế:`ế`,ề:`ề`,ễ:`ễ`,ė:`ė`,ȩ:`ȩ`,ḟ:`ḟ`,ǵ:`ǵ`,ḡ:`ḡ`,ğ:`ğ`,ǧ:`ǧ`,ĝ:`ĝ`,ġ:`ġ`,ģ:`ģ`,ḧ:`ḧ`,ȟ:`ȟ`,ĥ:`ĥ`,ḣ:`ḣ`,ḩ:`ḩ`,í:`í`,ì:`ì`,ï:`ï`,ḯ:`ḯ`,ĩ:`ĩ`,ī:`ī`,ĭ:`ĭ`,ǐ:`ǐ`,î:`î`,ǰ:`ǰ`,ĵ:`ĵ`,ḱ:`ḱ`,ǩ:`ǩ`,ķ:`ķ`,ĺ:`ĺ`,ľ:`ľ`,ļ:`ļ`,ḿ:`ḿ`,ṁ:`ṁ`,ń:`ń`,ǹ:`ǹ`,ñ:`ñ`,ň:`ň`,ṅ:`ṅ`,ņ:`ņ`,ó:`ó`,ò:`ò`,ö:`ö`,ȫ:`ȫ`,õ:`õ`,ṍ:`ṍ`,ṏ:`ṏ`,ȭ:`ȭ`,ō:`ō`,ṓ:`ṓ`,ṑ:`ṑ`,ŏ:`ŏ`,ǒ:`ǒ`,ô:`ô`,ố:`ố`,ồ:`ồ`,ỗ:`ỗ`,ȯ:`ȯ`,ȱ:`ȱ`,ő:`ő`,ṕ:`ṕ`,ṗ:`ṗ`,ŕ:`ŕ`,ř:`ř`,ṙ:`ṙ`,ŗ:`ŗ`,ś:`ś`,ṥ:`ṥ`,š:`š`,ṧ:`ṧ`,ŝ:`ŝ`,ṡ:`ṡ`,ş:`ş`,ẗ:`ẗ`,ť:`ť`,ṫ:`ṫ`,ţ:`ţ`,ú:`ú`,ù:`ù`,ü:`ü`,ǘ:`ǘ`,ǜ:`ǜ`,ǖ:`ǖ`,ǚ:`ǚ`,ũ:`ũ`,ṹ:`ṹ`,ū:`ū`,ṻ:`ṻ`,ŭ:`ŭ`,ǔ:`ǔ`,û:`û`,ů:`ů`,ű:`ű`,ṽ:`ṽ`,ẃ:`ẃ`,ẁ:`ẁ`,ẅ:`ẅ`,ŵ:`ŵ`,ẇ:`ẇ`,ẘ:`ẘ`,ẍ:`ẍ`,ẋ:`ẋ`,ý:`ý`,ỳ:`ỳ`,ÿ:`ÿ`,ỹ:`ỹ`,ȳ:`ȳ`,ŷ:`ŷ`,ẏ:`ẏ`,ẙ:`ẙ`,ź:`ź`,ž:`ž`,ẑ:`ẑ`,ż:`ż`,Á:`Á`,À:`À`,Ä:`Ä`,Ǟ:`Ǟ`,Ã:`Ã`,Ā:`Ā`,Ă:`Ă`,Ắ:`Ắ`,Ằ:`Ằ`,Ẵ:`Ẵ`,Ǎ:`Ǎ`,Â:`Â`,Ấ:`Ấ`,Ầ:`Ầ`,Ẫ:`Ẫ`,Ȧ:`Ȧ`,Ǡ:`Ǡ`,Å:`Å`,Ǻ:`Ǻ`,Ḃ:`Ḃ`,Ć:`Ć`,Ḉ:`Ḉ`,Č:`Č`,Ĉ:`Ĉ`,Ċ:`Ċ`,Ç:`Ç`,Ď:`Ď`,Ḋ:`Ḋ`,Ḑ:`Ḑ`,É:`É`,È:`È`,Ë:`Ë`,Ẽ:`Ẽ`,Ē:`Ē`,Ḗ:`Ḗ`,Ḕ:`Ḕ`,Ĕ:`Ĕ`,Ḝ:`Ḝ`,Ě:`Ě`,Ê:`Ê`,Ế:`Ế`,Ề:`Ề`,Ễ:`Ễ`,Ė:`Ė`,Ȩ:`Ȩ`,Ḟ:`Ḟ`,Ǵ:`Ǵ`,Ḡ:`Ḡ`,Ğ:`Ğ`,Ǧ:`Ǧ`,Ĝ:`Ĝ`,Ġ:`Ġ`,Ģ:`Ģ`,Ḧ:`Ḧ`,Ȟ:`Ȟ`,Ĥ:`Ĥ`,Ḣ:`Ḣ`,Ḩ:`Ḩ`,Í:`Í`,Ì:`Ì`,Ï:`Ï`,Ḯ:`Ḯ`,Ĩ:`Ĩ`,Ī:`Ī`,Ĭ:`Ĭ`,Ǐ:`Ǐ`,Î:`Î`,İ:`İ`,Ĵ:`Ĵ`,Ḱ:`Ḱ`,Ǩ:`Ǩ`,Ķ:`Ķ`,Ĺ:`Ĺ`,Ľ:`Ľ`,Ļ:`Ļ`,Ḿ:`Ḿ`,Ṁ:`Ṁ`,Ń:`Ń`,Ǹ:`Ǹ`,Ñ:`Ñ`,Ň:`Ň`,Ṅ:`Ṅ`,Ņ:`Ņ`,Ó:`Ó`,Ò:`Ò`,Ö:`Ö`,Ȫ:`Ȫ`,Õ:`Õ`,Ṍ:`Ṍ`,Ṏ:`Ṏ`,Ȭ:`Ȭ`,Ō:`Ō`,Ṓ:`Ṓ`,Ṑ:`Ṑ`,Ŏ:`Ŏ`,Ǒ:`Ǒ`,Ô:`Ô`,Ố:`Ố`,Ồ:`Ồ`,Ỗ:`Ỗ`,Ȯ:`Ȯ`,Ȱ:`Ȱ`,Ő:`Ő`,Ṕ:`Ṕ`,Ṗ:`Ṗ`,Ŕ:`Ŕ`,Ř:`Ř`,Ṙ:`Ṙ`,Ŗ:`Ŗ`,Ś:`Ś`,Ṥ:`Ṥ`,Š:`Š`,Ṧ:`Ṧ`,Ŝ:`Ŝ`,Ṡ:`Ṡ`,Ş:`Ş`,Ť:`Ť`,Ṫ:`Ṫ`,Ţ:`Ţ`,Ú:`Ú`,Ù:`Ù`,Ü:`Ü`,Ǘ:`Ǘ`,Ǜ:`Ǜ`,Ǖ:`Ǖ`,Ǚ:`Ǚ`,Ũ:`Ũ`,Ṹ:`Ṹ`,Ū:`Ū`,Ṻ:`Ṻ`,Ŭ:`Ŭ`,Ǔ:`Ǔ`,Û:`Û`,Ů:`Ů`,Ű:`Ű`,Ṽ:`Ṽ`,Ẃ:`Ẃ`,Ẁ:`Ẁ`,Ẅ:`Ẅ`,Ŵ:`Ŵ`,Ẇ:`Ẇ`,Ẍ:`Ẍ`,Ẋ:`Ẋ`,Ý:`Ý`,Ỳ:`Ỳ`,Ÿ:`Ÿ`,Ỹ:`Ỹ`,Ȳ:`Ȳ`,Ŷ:`Ŷ`,Ẏ:`Ẏ`,Ź:`Ź`,Ž:`Ž`,Ẑ:`Ẑ`,Ż:`Ż`,ά:`ά`,ὰ:`ὰ`,ᾱ:`ᾱ`,ᾰ:`ᾰ`,έ:`έ`,ὲ:`ὲ`,ή:`ή`,ὴ:`ὴ`,ί:`ί`,ὶ:`ὶ`,ϊ:`ϊ`,ΐ:`ΐ`,ῒ:`ῒ`,ῑ:`ῑ`,ῐ:`ῐ`,ό:`ό`,ὸ:`ὸ`,ύ:`ύ`,ὺ:`ὺ`,ϋ:`ϋ`,ΰ:`ΰ`,ῢ:`ῢ`,ῡ:`ῡ`,ῠ:`ῠ`,ώ:`ώ`,ὼ:`ὼ`,Ύ:`Ύ`,Ὺ:`Ὺ`,Ϋ:`Ϋ`,Ῡ:`Ῡ`,Ῠ:`Ῠ`,Ώ:`Ώ`,Ὼ:`Ὼ`},MU=class e{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode=`math`,this.gullet=new DU(e,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new L(`Expected '`+e+`', got '`+this.fetch().text+`'`,this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken??=this.gullet.expandNextToken(),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set(`\\color`,`\\textcolor`);try{var e=this.parseExpression(!1);return this.expect(`EOF`),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new _H(`}`)),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect(`}`),this.nextToken=t,n}parseExpression(t,n){for(var r=[];;){this.mode===`math`&&this.consumeSpaces();var i=this.fetch();if(e.endOfExpression.has(i.text)||n&&i.text===n||t&&sU[i.text]&&sU[i.text].infix)break;var a=this.parseAtom(n);if(!a)break;a.type!==`internal`&&r.push(a)}return this.mode===`text`&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){for(var t=-1,n,r=0;r<e.length;r++){var i=e[r];if(i.type===`infix`){if(t!==-1)throw new L(`only one infix operator per group`,i.token);t=r,n=i.replaceWith}}if(t!==-1&&n){var a,o,s=e.slice(0,t),c=e.slice(t+1);return a=s.length===1&&s[0].type===`ordgroup`?s[0]:{type:`ordgroup`,mode:this.mode,body:s},o=c.length===1&&c[0].type===`ordgroup`?c[0]:{type:`ordgroup`,mode:this.mode,body:c},[n===`\\\\abovefrac`?this.callFunction(n,[a,e[t],o],[]):this.callFunction(n,[a,o],[])]}else return e}handleSupSubscript(e){var t=this.fetch(),n=t.text;this.consume(),this.consumeSpaces();var r;do r=this.parseGroup(e);while(r?.type===`internal`);if(!r)throw new L(`Expected group after '`+n+`'`,t);return r}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:`textord`,mode:`text`,text:e[n]});var r={type:`text`,mode:this.mode,body:t};return{type:`color`,mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){var t=this.parseGroup(`atom`,e);if(t?.type===`internal`||this.mode===`text`)return t;for(var n,r;;){this.consumeSpaces();var i=this.fetch();if(i.text===`\\limits`||i.text===`\\nolimits`){if(t&&t.type===`op`)t.limits=i.text===`\\limits`,t.alwaysHandleSupSub=!0;else if(t&&t.type===`operatorname`)t.alwaysHandleSupSub&&(t.limits=i.text===`\\limits`);else throw new L(`Limit controls must follow a math operator`,i);this.consume()}else if(i.text===`^`){if(n)throw new L(`Double superscript`,i);n=this.handleSupSubscript(`superscript`)}else if(i.text===`_`){if(r)throw new L(`Double subscript`,i);r=this.handleSupSubscript(`subscript`)}else if(i.text===`'`){if(n)throw new L(`Double superscript`,i);var a={type:`textord`,mode:this.mode,text:`\\prime`},o=[a];for(this.consume();this.fetch().text===`'`;)o.push(a),this.consume();this.fetch().text===`^`&&o.push(this.handleSupSubscript(`superscript`)),n={type:`ordgroup`,mode:this.mode,body:o}}else if(kU[i.text]){var s=OU.test(i.text),c=[];for(c.push(new _H(kU[i.text])),this.consume();;){var l=this.fetch().text;if(!kU[l]||OU.test(l)!==s)break;c.unshift(new _H(kU[l])),this.consume()}var u=this.subparse(c);s?r={type:`ordgroup`,mode:`math`,body:u}:n={type:`ordgroup`,mode:`math`,body:u}}else break}return n||r?{type:`supsub`,mode:this.mode,base:t,sup:n,sub:r}:t}parseFunction(e,t){var n=this.fetch(),r=n.text,i=sU[r];if(!i)return null;if(this.consume(),t&&t!==`atom`&&!i.allowedInArgument)throw new L(`Got function '`+r+`' with no arguments`+(t?` as `+t:``),n);if(this.mode===`text`&&!i.allowedInText)throw new L(`Can't use function '`+r+`' in text mode`,n);if(this.mode===`math`&&i.allowedInMath===!1)throw new L(`Can't use function '`+r+`' in math mode`,n);var{args:a,optArgs:o}=this.parseArguments(r,i);return this.callFunction(r,a,o,n,e)}callFunction(e,t,n,r,i){var a={funcName:e,parser:this,token:r,breakOnTokenText:i},o=sU[e];if(o&&o.handler)return o.handler(a,t,n);throw new L(`No function handler for `+e)}parseArguments(e,t){var n=t.numArgs+t.numOptionalArgs;if(n===0)return{args:[],optArgs:[]};for(var r=[],i=[],a=0;a<n;a++){var o=t.argTypes&&t.argTypes[a],s=a<t.numOptionalArgs;(`primitive`in t&&t.primitive&&o==null||t.type===`sqrt`&&a===1&&i[0]==null)&&(o=`primitive`);var c=this.parseGroupOfType(`argument to '`+e+`'`,o,s);if(s)i.push(c);else if(c!=null)r.push(c);else throw new L(`Null argument, please report this as a bug`)}return{args:r,optArgs:i}}parseGroupOfType(e,t,n){switch(t){case`color`:return this.parseColorGroup(n);case`size`:return this.parseSizeGroup(n);case`url`:return this.parseUrlGroup(n);case`math`:case`text`:return this.parseArgumentGroup(n,t);case`hbox`:var r=this.parseArgumentGroup(n,`text`);return r==null?null:{type:`styling`,mode:r.mode,body:[r],style:`text`,resetFont:!0};case`raw`:var i=this.parseStringGroup(`raw`,n);return i==null?null:{type:`raw`,mode:`text`,string:i.text};case`primitive`:if(n)throw new L(`A primitive argument cannot be optional`);var a=this.parseGroup(e);if(a==null)throw new L(`Expected group as `+e,this.fetch());return a;case`original`:case null:case void 0:return this.parseArgumentGroup(n);default:throw new L(`Unknown group type as `+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===` `;)this.consume()}parseStringGroup(e,t){var n=this.gullet.scanArgument(t);if(n==null)return null;for(var r=``,i;(i=this.fetch()).text!==`EOF`;)r+=i.text,this.consume();return this.consume(),n.text=r,n}parseRegexGroup(e,t){for(var n=this.fetch(),r=n,i=``,a;(a=this.fetch()).text!==`EOF`&&e.test(i+a.text);)r=a,i+=r.text,this.consume();if(i===``)throw new L(`Invalid `+t+`: '`+n.text+`'`,n);return n.range(r,i)}parseColorGroup(e){var t=this.parseStringGroup(`color`,e);if(t==null)return null;var n=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new L(`Invalid color: '`+t.text+`'`,t);var r=n[0];return/^[0-9a-f]{6}$/i.test(r)&&(r=`#`+r),{type:`color-token`,mode:this.mode,color:r}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),t=!e&&this.gullet.future().text!==`{`?this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,`size`):this.parseStringGroup(`size`,e),!t)return null;!e&&t.text.length===0&&(t.text=`0pt`,n=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new L(`Invalid size: '`+t.text+`'`,t);var i={number:+(r[1]+r[2]),unit:r[3]};if(!OR(i))throw new L(`Invalid unit: '`+i.unit+`'`,t);return{type:`size`,mode:this.mode,value:i,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode(`%`,13),this.gullet.lexer.setCatcode(`~`,12);var t=this.parseStringGroup(`url`,e);if(this.gullet.lexer.setCatcode(`%`,14),this.gullet.lexer.setCatcode(`~`,13),t==null)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,`$1`);return{type:`url`,mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(n==null)return null;var r=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var i=this.parseExpression(!1,`EOF`);this.expect(`EOF`),this.gullet.endGroup();var a={type:`ordgroup`,mode:this.mode,loc:n.loc,body:i};return t&&this.switchMode(r),a}parseGroup(e,t){var n=this.fetch(),r=n.text,i;if(r===`{`||r===`\\begingroup`){this.consume();var a=r===`{`?`}`:`\\endgroup`;this.gullet.beginGroup();var o=this.parseExpression(!1,a),s=this.fetch();this.expect(a),this.gullet.endGroup(),i={type:`ordgroup`,mode:this.mode,loc:gH.range(n,s),body:o,semisimple:r===`\\begingroup`||void 0}}else if(i=this.parseFunction(t,e)||this.parseSymbol(),i==null&&r[0]===`\\`&&!EU.hasOwnProperty(r)){if(this.settings.throwOnError)throw new L(`Undefined control sequence: `+r,n);i=this.formatUnsupportedCmd(r),this.consume()}return i}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var r=e[n];if(r.type===`textord`){var i=r.text,a=e[n+1];if(!(!a||a.type!==`textord`)){if(i===`-`&&a.text===`-`){var o=e[n+2];n+1<t&&o&&o.type===`textord`&&o.text===`-`?(e.splice(n,3,{type:`textord`,mode:`text`,loc:gH.range(r,o),text:`---`}),t-=2):(e.splice(n,2,{type:`textord`,mode:`text`,loc:gH.range(r,a),text:`--`}),--t)}(i===`'`||i==="`")&&a.text===i&&(e.splice(n,2,{type:`textord`,mode:`text`,loc:gH.range(r,a),text:i+i}),--t)}}}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r=n.charAt(0)===`*`;if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new L(`\\verb assertion failed --
|
|
353
|
+
please report what input caused this bug`);return n=n.slice(1,-1),{type:`verb`,mode:`text`,body:n,star:r}}jU.hasOwnProperty(t[0])&&!ez[this.mode][t[0]]&&(this.settings.strict&&this.mode===`math`&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Accented Unicode text character "`+t[0]+`" used in math mode`,e),t=jU[t[0]]+t.slice(1));var i=mU.exec(t);i&&(t=t.substring(0,i.index),t===`i`?t=`ı`:t===`j`&&(t=`ȷ`));var a;if(ez[this.mode][t]){this.settings.strict&&this.mode===`math`&&Cz.includes(t)&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Latin-1/Unicode text character "`+t[0]+`" used in math mode`,e);var o=ez[this.mode][t].group,s=gH.range(e);a=sV(o)?{type:`atom`,mode:this.mode,family:o,loc:s,text:t}:{type:o,mode:this.mode,loc:s,text:t}}else if(t.charCodeAt(0)>=128)this.settings.strict&&(uR(t.charCodeAt(0))?this.mode===`math`&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Unicode text character "`+t[0]+`" used in math mode`,e):this.settings.reportNonstrict(`unknownSymbol`,`Unrecognized Unicode character "`+t[0]+`"`+(` (`+t.charCodeAt(0)+`)`),e)),a={type:`textord`,mode:`text`,loc:gH.range(e),text:t};else return null;if(this.consume(),i)for(var c=0;c<i[0].length;c++){var l=i[0][c];if(!AU[l])throw new L(`Unknown accent ' `+l+`'`,e);var u=AU[l][this.mode]||AU[l].text;if(!u)throw new L(`Accent `+l+` unsupported in `+this.mode+` mode`,e);a={type:`accent`,mode:this.mode,loc:gH.range(e),label:u,isStretchy:!1,isShifty:!0,base:a}}return a}};MU.endOfExpression=new Set([`}`,`\\endgroup`,`\\end`,`\\right`,`&`]);var NU=function(e,t){if(!(typeof e==`string`||e instanceof String))throw TypeError(`KaTeX can only parse string typed expression`);var n=new MU(e,t);delete n.gullet.macros.current[`\\df@tag`];var r=n.parse();if(delete n.gullet.macros.current[`\\current@color`],delete n.gullet.macros.current[`\\color`],n.gullet.macros.get(`\\df@tag`)){if(!t.displayMode)throw new L(`\\tag works only in display equations`);r=[{type:`tag`,mode:`text`,body:r,tag:n.subparse([new _H(`\\df@tag`)])}]}return r},PU=function(e,t,n){t.textContent=``;var r=RU(e,n).toNode();t.appendChild(r)};typeof document<`u`&&document.compatMode!==`CSS1Compat`&&(typeof console<`u`&&console.warn(`Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype.`),PU=function(){throw new L(`KaTeX doesn't work in quirks mode.`)});var FU=function(e,t){return RU(e,t).toMarkup()},IU=function(e,t){return NU(e,new UL(t))},LU=function(e,t,n){if(n.throwOnError||!(e instanceof L))throw e;var r=J([`katex-error`],[new BR(t)]);return r.setAttribute(`title`,e.toString()),r.setAttribute(`style`,`color:`+n.errorColor),r},RU=function(e,t){var n=new UL(t);try{return ZB(NU(e,n),e,n)}catch(t){return LU(t,e,n)}},zU={version:`0.16.47`,render:PU,renderToString:FU,ParseError:L,SETTINGS_SCHEMA:zL,__parse:IU,__renderToDomTree:RU,__renderToHTMLTree:function(e,t){var n=new UL(t);try{return QB(NU(e,n),e,n)}catch(t){return LU(t,e,n)}},__setFontMetrics:XR,__defineSymbol:z,__defineFunction:Y,__defineMacro:Z,__domTree:{Span:IR,Anchor:LR,SymbolNode:BR,SvgNode:VR,PathNode:HR,LineNode:UR}},BU=`math_block`,VU=5,HU=1200,UU=e=>(0,f.renderToStaticMarkup)((0,d.createElement)(e,{size:14,strokeWidth:2,"aria-hidden":`true`})),WU=UU(TE),GU=UU(yE),KU=e=>typeof e==`function`?e():null,qU=e=>typeof e.props.editable==`function`?e.props.editable(e.state):e.editable,JU=class{syncEditableState(){this.dom.dataset.editable=qU(this.view)?`true`:`false`}constructor(e,t,n,r){this.pointerStartX=null,this.pointerStartY=null,this.hasDragged=!1,this.isDeletingByBackspace=!1,this.copyFeedbackTimer=null,this.handleClick=()=>{if(this.hasDragged){this.hasDragged=!1;return}this.enterEditMode()},this.handlePointerDown=e=>{this.pointerStartX=e.clientX,this.pointerStartY=e.clientY,this.hasDragged=!1},this.handlePointerMove=e=>{if(this.pointerStartX===null||this.pointerStartY===null)return;let t=Math.abs(e.clientX-this.pointerStartX),n=Math.abs(e.clientY-this.pointerStartY);(t>=VU||n>=VU)&&(this.hasDragged=!0)},this.handlePointerUp=()=>{this.pointerStartX=null,this.pointerStartY=null},this.handleCopyClick=e=>{if(e.preventDefault(),e.stopPropagation(),!qU(this.view))return;let t=typeof this.node.attrs.value==`string`?this.node.attrs.value:``;(typeof navigator<`u`&&navigator.clipboard?.writeText?navigator.clipboard.writeText(t):Promise.resolve()).then(()=>{this.copyButton.innerHTML=GU,this.copyButton.dataset.copied=`true`,this.copyFeedbackTimer!==null&&clearTimeout(this.copyFeedbackTimer),this.copyFeedbackTimer=setTimeout(()=>{this.copyButton.innerHTML=WU,delete this.copyButton.dataset.copied,this.copyFeedbackTimer=null},HU)}).catch(()=>{})},this.handleDeleteClick=e=>{e.preventDefault(),e.stopPropagation(),qU(this.view)&&this.deleteCurrentMathBlock()},this.handleInput=()=>{let e=this.sourceTextarea.value,t=KU(this.getPos);if(t===null)return;this.renderMath(e);let n=this.view.state.tr.setNodeMarkup(t,void 0,{...this.node.attrs,value:e});n.docChanged&&this.view.dispatch(n)},this.handleKeyDown=e=>{let t=this.sourceTextarea.selectionStart,n=this.sourceTextarea.selectionEnd;if(e.key===`Backspace`){if(!(t===0&&n===0)||KU(this.getPos)===null)return;e.preventDefault(),this.deleteCurrentMathBlock();return}if(e.key!==`ArrowUp`&&e.key!==`ArrowDown`||t!==n)return;let r=this.sourceTextarea.value,i=r.slice(0,t),a=r.slice(n),o=!i.includes(`
|
|
302
354
|
`),s=!a.includes(`
|
|
303
|
-
`);if(!(e.key===`ArrowUp`&&o||e.key===`ArrowDown`&&s))return;let c=Yh(this.getPos);if(c===null)return;e.preventDefault();let l=e.key===`ArrowUp`?c:Math.min(c+this.node.nodeSize,this.view.state.doc.content.size),u=e.key===`ArrowUp`?-1:1,d=this.view.state.tr.setSelection(this.createBoundarySelection(l,u)).scrollIntoView();this.view.dispatch(d),this.view.focus()},this.handleBlur=()=>{this.isDeletingByBackspace||this.exitEditMode()},this.node=e,this.view=t,this.getPos=n,this.messages=r,this.dom=document.createElement(`div`),this.dom.dataset.type=Uh,this.dom.className=`zt-md-math-block`,this.syncEditableState(),this.sourceContainer=document.createElement(`div`),this.sourceContainer.className=`zt-md-math-block-source`,this.sourceContainer.hidden=!0,this.sourceTextarea=document.createElement(`textarea`),this.sourceTextarea.className=`zt-md-math-block-textarea`,this.sourceTextarea.setAttribute(`aria-label`,this.messages.mathBlockSourceAriaLabel),this.sourceTextarea.spellcheck=!1,this.previewContainer=document.createElement(`div`),this.previewContainer.className=`zt-md-math-block-preview`,this.actionsContainer=document.createElement(`div`),this.actionsContainer.className=`zt-md-math-block-actions`,this.copyButton=document.createElement(`button`),this.copyButton.type=`button`,this.copyButton.className=`zt-md-math-block-action-button`,this.copyButton.setAttribute(`aria-label`,this.messages.mathBlockCopyAriaLabel),this.copyButton.innerHTML=qh,this.deleteButton=document.createElement(`button`),this.deleteButton.type=`button`,this.deleteButton.className=`zt-md-math-block-action-button zt-md-math-block-action-button-danger`,this.deleteButton.setAttribute(`aria-label`,this.messages.mathBlockDeleteAriaLabel),this.deleteButton.innerHTML=Kh(nt),this.errorContainer=document.createElement(`div`),this.errorContainer.className=`zt-md-math-block-error`,this.errorContainer.hidden=!0,this.actionsContainer.append(this.copyButton,this.deleteButton),this.sourceContainer.appendChild(this.sourceTextarea),this.previewContainer.appendChild(this.errorContainer),this.dom.append(this.actionsContainer,this.sourceContainer,this.previewContainer),this.syncFromNode(e),this.dom.addEventListener(`click`,this.handleClick),this.dom.addEventListener(`pointerdown`,this.handlePointerDown),this.dom.addEventListener(`pointermove`,this.handlePointerMove),this.dom.addEventListener(`pointerup`,this.handlePointerUp),this.dom.addEventListener(`pointercancel`,this.handlePointerUp),this.copyButton.addEventListener(`click`,this.handleCopyClick),this.deleteButton.addEventListener(`click`,this.handleDeleteClick),this.sourceTextarea.addEventListener(`input`,this.handleInput),this.sourceTextarea.addEventListener(`keydown`,this.handleKeyDown),this.sourceTextarea.addEventListener(`blur`,this.handleBlur)}deleteCurrentMathBlock(){let e=Yh(this.getPos);if(e===null)return;this.isDeletingByBackspace=!0;let n=this.view.state.tr.delete(e,e+this.node.nodeSize),r=Math.min(e,n.doc.content.size);n.setSelection(t.c.near(n.doc.resolve(r),-1)).scrollIntoView(),this.view.dispatch(n),requestAnimationFrame(()=>{this.view.focus(),this.isDeletingByBackspace=!1})}createBoundarySelection(e,n){let r=this.view.state.doc.resolve(e);return D.valid(r)?new D(r):t.c.near(r,n)}syncFromNode(e){let t=typeof e.attrs.value==`string`?e.attrs.value:``;this.dom.dataset.value=t,this.sourceTextarea.value=t,this.renderMath(t)}renderMath(e){this.errorContainer.hidden=!0,this.errorContainer.textContent=``;try{Hh.render(e,this.previewContainer,{displayMode:!0,throwOnError:!0}),this.previewContainer.appendChild(this.errorContainer)}catch{this.previewContainer.textContent=e,this.errorContainer.hidden=!1,this.errorContainer.textContent=this.messages.mathRenderError,this.previewContainer.appendChild(this.errorContainer)}}enterEditMode(){Xh(this.view)&&(this.sourceContainer.hidden=!1,this.dom.classList.add(`zt-md-math-block-editing`),this.sourceTextarea.focus())}exitEditMode(){this.sourceContainer.hidden=!0,this.dom.classList.remove(`zt-md-math-block-editing`)}update(e){return e.type.name===Uh?(this.node=e,this.syncEditableState(),this.syncFromNode(e),!0):!1}selectNode(){this.enterEditMode()}deselectNode(){this.exitEditMode()}stopEvent(e){let t=e.target;return t instanceof Node?this.sourceContainer.contains(t)||this.actionsContainer.contains(t):!1}ignoreMutation(){return!0}destroy(){this.dom.removeEventListener(`click`,this.handleClick),this.dom.removeEventListener(`pointerdown`,this.handlePointerDown),this.dom.removeEventListener(`pointermove`,this.handlePointerMove),this.dom.removeEventListener(`pointerup`,this.handlePointerUp),this.dom.removeEventListener(`pointercancel`,this.handlePointerUp),this.copyButton.removeEventListener(`click`,this.handleCopyClick),this.deleteButton.removeEventListener(`click`,this.handleDeleteClick),this.sourceTextarea.removeEventListener(`input`,this.handleInput),this.sourceTextarea.removeEventListener(`keydown`,this.handleKeyDown),this.sourceTextarea.removeEventListener(`blur`,this.handleBlur),this.copyFeedbackTimer!==null&&(clearTimeout(this.copyFeedbackTimer),this.copyFeedbackTimer=null),this.copyButton.innerHTML=qh,delete this.copyButton.dataset.copied}},Qh=(e=cn())=>(t,n,r)=>new Zh(t,n,typeof r==`function`?()=>{let e=r();return typeof e==`number`?e:0}:!1,e),$h=`math_inline`,eg=new t.a(`zt-md-math-inline-edit`),tg=e=>typeof e.props.editable==`function`?e.props.editable(e.state):e.editable,ng=e=>e?.type.name===$h,rg=e=>String(e.attrs.value??e.textContent??``),ig=(e,t,n)=>{tg(e)&&e.dispatch(e.state.tr.setMeta(eg,{type:`open`,position:t,caret:n?.caret===`start`?`start`:`end`}))},ag=class{createSafeTextSelection(e,n){try{return t.c.create(e,n)}catch{return t.c.near(e.resolve(n),-1)}}resolveArrowExitTarget(e){if(this.currentPosition===null)return null;let t=this.resolveCurrentNode();if(!t)return null;let n=this.sourceInput.selectionStart,r=this.sourceInput.selectionEnd;if(n===null||r===null||n!==r)return null;if(e.key===`ArrowLeft`&&n===0||e.key===`ArrowUp`)return this.currentPosition;let i=this.sourceInput.value.length;return e.key===`ArrowRight`&&n===i||e.key===`ArrowDown`?this.currentPosition+t.nodeSize:null}shouldDeleteMathInlineOnBackspace(e){if(e.key!==`Backspace`||this.currentPosition===null)return!1;let t=this.sourceInput.selectionStart,n=this.sourceInput.selectionEnd;return t===null||n===null||t!==0||n!==0?!1:!!this.resolveCurrentNode()}deleteCurrentMathInlineAndFocusEditor(){if(this.currentPosition===null)return;let e=this.resolveCurrentNode();if(!e){this.closeEditor(!1);return}let t=this.currentPosition,n=this.currentPosition+e.nodeSize,r=this.view.state.tr.delete(t,n);r.setSelection(this.createSafeTextSelection(r.doc,t)).setMeta(eg,{type:`close`}).scrollIntoView(),this.view.dispatch(r),this.view.focus()}constructor(e,t){this.currentPosition=null,this.currentMathInlineElement=null,this.isCommitting=!1,this.currentCaret=`end`,this.handleMouseDown=e=>{e.stopPropagation()},this.handleBeforeInput=e=>{e.stopPropagation()},this.handleInput=e=>{e.stopPropagation(),this.renderMath(this.sourceInput.value)},this.handleKeyDown=e=>{if(e.stopPropagation(),this.shouldDeleteMathInlineOnBackspace(e)){e.preventDefault(),this.deleteCurrentMathInlineAndFocusEditor();return}let t=this.resolveArrowExitTarget(e);if(t!==null){e.preventDefault(),this.commitCurrentValue(t);return}if(e.key===`Enter`){e.preventDefault(),this.commitCurrentValue();return}e.key===`Escape`&&(e.preventDefault(),this.closeEditor(!0))},this.handleBlur=()=>{this.isCommitting||this.currentPosition===null||this.commitCurrentValue()},this.view=e,this.messages=t,this.host=document.createElement(`span`),this.host.className=`zt-md-math-inline-editor`,this.host.style.display=`none`,this.sourceInput=document.createElement(`input`),this.sourceInput.type=`text`,this.sourceInput.className=`zt-md-math-inline-editor-input`,this.sourceInput.setAttribute(`aria-label`,this.messages.mathBlockSourceAriaLabel),this.sourceInput.spellcheck=!1,this.previewContainer=document.createElement(`span`),this.previewContainer.className=`zt-md-math-inline-editor-preview`,this.errorContainer=document.createElement(`span`),this.errorContainer.className=`zt-md-math-inline-editor-error`,this.errorContainer.hidden=!0,this.host.append(this.sourceInput,this.previewContainer,this.errorContainer),this.sourceInput.addEventListener(`input`,this.handleInput),this.sourceInput.addEventListener(`beforeinput`,this.handleBeforeInput),this.sourceInput.addEventListener(`keydown`,this.handleKeyDown),this.sourceInput.addEventListener(`blur`,this.handleBlur),this.host.addEventListener(`mousedown`,this.handleMouseDown),this.update(e)}renderMath(e){this.errorContainer.hidden=!0,this.errorContainer.textContent=``,this.previewContainer.textContent=``;try{Hh.render(e,this.previewContainer,{displayMode:!1,throwOnError:!0})}catch{this.previewContainer.textContent=e,this.errorContainer.hidden=!1,this.errorContainer.textContent=this.messages.mathRenderError}}resolveCurrentNode(){if(this.currentPosition===null)return null;let e=this.view.state.doc.nodeAt(this.currentPosition);return ng(e)?e:null}openEditor(e){if(!tg(this.view)){this.closeEditor(!1);return}let t=this.view.state.doc.nodeAt(e);if(!ng(t)){this.closeEditor(!1);return}this.currentPosition=e,this.sourceInput.value=rg(t),this.renderMath(this.sourceInput.value);let n=this.resolveMathInlineElement(e);if(!n){this.closeEditor(!1);return}this.currentMathInlineElement=n,n.dataset.editing=`true`,n.append(this.host),this.host.style.display=`inline-flex`,requestAnimationFrame(()=>{if(this.currentPosition!==e)return;this.sourceInput.focus();let t=this.sourceInput.value.length;if(this.currentCaret===`start`){this.sourceInput.setSelectionRange(0,0);return}this.sourceInput.setSelectionRange(t,t)})}commitCurrentValue(e){if(this.currentPosition===null)return;let t=this.resolveCurrentNode();if(!t){this.closeEditor(!1);return}let n=this.sourceInput.value,r=typeof e==`number`?e:this.currentPosition+t.nodeSize,i=this.view.state.tr.setNodeMarkup(this.currentPosition,void 0,{...t.attrs,value:n});i.setSelection(this.createSafeTextSelection(i.doc,r)).setMeta(eg,{type:`close`}).scrollIntoView(),this.isCommitting=!0,this.view.dispatch(i),this.isCommitting=!1,this.view.focus()}closeEditor(e){this.currentMathInlineElement&&(this.currentMathInlineElement.dataset.editing=`false`),this.currentPosition=null,this.currentMathInlineElement=null,this.host.style.display=`none`,this.host.remove(),e&&this.view.dispatch(this.view.state.tr.setMeta(eg,{type:`close`}))}resolveMathInlineElement(e){let t=this.view.nodeDOM(e);return t instanceof HTMLElement?t:null}update(e){if(this.view=e,!tg(e)){this.closeEditor(!1);return}let t=eg.getState(e.state);if(!t||t.position===null){this.currentPosition!==null&&this.closeEditor(!1);return}if(this.currentPosition!==t.position){this.currentCaret=t.caret,this.openEditor(t.position);return}if(!this.resolveCurrentNode()){this.closeEditor(!0);return}}destroy(){this.sourceInput.removeEventListener(`input`,this.handleInput),this.sourceInput.removeEventListener(`beforeinput`,this.handleBeforeInput),this.sourceInput.removeEventListener(`keydown`,this.handleKeyDown),this.sourceInput.removeEventListener(`blur`,this.handleBlur),this.host.removeEventListener(`mousedown`,this.handleMouseDown),this.currentMathInlineElement&&(this.currentMathInlineElement.dataset.editing=`false`),this.host.remove()}},og=(e,n)=>r.u(()=>new t.i({key:eg,state:{init:()=>({position:null,caret:`end`}),apply:(e,t)=>{let n=e.getMeta(eg);if(n?.type===`open`&&typeof n.position==`number`)return{position:n.position,caret:n.caret===`start`?`start`:`end`};if(n?.type===`close`)return{position:null,caret:`end`};if(t.position===null||!e.docChanged)return t;let r=e.mapping.map(t.position,-1);return ng(e.doc.nodeAt(r))?{position:r,caret:t.caret}:{position:null,caret:`end`}}},view:t=>new ag(t,e)})),sg=`math_inline`,cg=e=>typeof e==`function`?e():null,lg=e=>typeof e.props.editable==`function`?e.props.editable(e.state):e.editable,ug=e=>String(e.attrs.value??e.textContent??``),dg=class{syncEditableState(){this.dom.dataset.editable=lg(this.view)?`true`:`false`}constructor(e,t,n,r){this.handleMouseDown=e=>{lg(this.view)||(e.preventDefault(),e.stopPropagation())},this.handleClick=e=>{if(e.preventDefault(),e.stopPropagation(),!lg(this.view))return;let t=cg(this.getPos);t!==null&&ig(this.view,t)},this.node=e,this.view=t,this.getPos=n,this.messages=r,this.dom=document.createElement(`span`),this.dom.dataset.type=sg,this.dom.className=`zt-md-math-inline`,this.dom.dataset.editing=`false`,this.syncEditableState(),this.previewContainer=document.createElement(`span`),this.previewContainer.className=`zt-md-math-inline-preview`,this.errorContainer=document.createElement(`span`),this.errorContainer.className=`zt-md-math-inline-error`,this.errorContainer.hidden=!0,this.dom.append(this.previewContainer,this.errorContainer),this.syncFromNode(e),this.dom.addEventListener(`mousedown`,this.handleMouseDown),this.dom.addEventListener(`click`,this.handleClick)}syncFromNode(e){let t=ug(e);this.dom.dataset.value=t,this.renderMath(t)}renderMath(e){this.errorContainer.hidden=!0,this.errorContainer.textContent=``,this.previewContainer.textContent=``;try{Hh.render(e,this.previewContainer,{displayMode:!1,throwOnError:!0})}catch{this.previewContainer.textContent=e,this.errorContainer.hidden=!1,this.errorContainer.textContent=this.messages.mathRenderError}}update(e){return e.type.name===sg?(this.node=e,this.syncEditableState(),this.syncFromNode(e),!0):!1}stopEvent(e){let t=e.target;return t instanceof Element?e.type===`click`||!!t.closest(`.zt-md-math-inline-editor`):e.type===`click`}ignoreMutation(){return!0}destroy(){this.dom.removeEventListener(`mousedown`,this.handleMouseDown),this.dom.removeEventListener(`click`,this.handleClick)}},fg=(e=cn())=>(t,n,r)=>new dg(t,n,typeof r==`function`?()=>{let e=r();return typeof e==`number`?e:0}:!1,e),pg=`math_inline`,mg=`zt-md-math-inline-arrow-navigation`,hg={ArrowLeft:{positionKey:`from`},ArrowRight:{positionKey:`to`}},gg={ArrowLeft:`end`,ArrowRight:`start`},_g={Backspace:`before`,Delete:`after`},vg=e=>e instanceof Element?!!e.closest(`.zt-md-math-inline-editor`):!1,yg=e=>e?.type.name===pg,bg=e=>!_g[e.key]||e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||vg(e.target)||vg(document.activeElement),xg=(e,n)=>{if(!hg[n.key]||vg(n.target))return!1;let{selection:r}=e.state;return!(r instanceof t.r)||r.node.type.name!==pg?!1:(n.preventDefault(),ig(e,r.from,{caret:gg[n.key]??`end`}),!0)},Sg=(e,t)=>{let n=hg[t.key];if(!n||vg(t.target))return!1;let{selection:r}=e.state;if(!r.empty)return!1;let i=r.$from,a=n.positionKey===`from`?i.nodeBefore:i.nodeAfter;return yg(a)?(t.preventDefault(),ig(e,n.positionKey===`from`?r.from-a.nodeSize:r.from,{caret:gg[t.key]??`end`}),!0):!1},Cg=(e,n)=>{try{return t.c.create(e,n)}catch{return t.c.near(e.resolve(n),-1)}},wg=(e,t,n)=>{n.preventDefault();let r=t.from,i=e.state.tr.delete(t.from,t.to),a=i.doc.content.size,o=Math.min(r,a);return i.setSelection(Cg(i.doc,o)).scrollIntoView(),e.dispatch(i),e.focus(),!0},Tg=(e,n)=>{let r=_g[n.key];if(!r)return!1;let{selection:i}=e.state;if(!i.empty)return!1;let a=i.$from,o=r===`before`?a.nodeBefore:a.nodeAfter;if(!yg(o))return!1;n.preventDefault();let s=r===`before`?i.from-o.nodeSize:i.from;return e.dispatch(e.state.tr.setSelection(t.r.create(e.state.doc,s)).scrollIntoView()),e.focus(),!0},Eg=(e,n)=>{if(bg(n))return!1;let{selection:r}=e.state;return r instanceof t.r&&yg(r.node)?wg(e,r,n):Tg(e,n)},Dg=(e,n)=>{if(vg(document.activeElement))return!1;let{selection:r}=e.state;if(!(r instanceof t.r)||r.node.type.name!==pg)return!1;let i=r.to,a=i+n.length,o=e.state.tr.insertText(n,i,i);return o.setSelection(t.c.create(o.doc,a)).scrollIntoView(),e.dispatch(o),e.focus(),!0},Og=r.u(()=>new t.i({key:new t.a(mg),props:{handleKeyDown:(e,t)=>Sg(e,t)||Eg(e,t)?!0:xg(e,t),handleTextInput:(e,t,n,r)=>Dg(e,r)}}));function kg(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:a},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:s,mathText:o,mathTextData:s}};function e(e){this.enter({type:`math`,meta:null,value:``,data:{hName:`pre`,hChildren:[{type:`element`,tagName:`code`,properties:{className:[`language-math`,`math-display`]},children:[]}]}},e)}function t(){this.buffer()}function n(){let e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.meta=e}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(e){let t=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t;let r=n.data.hChildren[0];r.type,r.tagName,r.children.push({type:`text`,value:t}),this.data.mathFlowInside=void 0}function a(e){this.enter({type:`inlineMath`,value:``,data:{hName:`code`,hProperties:{className:[`language-math`,`math-inline`]},hChildren:[]}},e),this.buffer()}function o(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t,n.data.hChildren.push({type:`text`,value:t})}function s(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}}function Ag(t){let n=(t||{}).singleDollarTextMath;return n??=!0,i.peek=a,{unsafe:[{character:`\r`,inConstruct:`mathFlowMeta`},{character:`
|
|
304
|
-
`,inConstruct:`mathFlowMeta`},{character:`$`,after:
|
|
305
|
-
`,before:
|
|
306
|
-
`),
|
|
307
|
-
`)),l+=o.move(s),c(),l}function i(e,t,r){let i=e.value||``,a=1;for(n||a++;RegExp(`(^|[^$])`+`\\$`.repeat(a)+`([^$]|$)`).test(i);)a++;let o=`$`.repeat(a);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` `+i+` `);let s=-1;for(;++s<r.unsafe.length;){let e=r.unsafe[s];if(!e.atBreak)continue;let t=r.compilePattern(e),n;for(;n=t.exec(i);){let e=n.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=i.slice(0,e)+` `+i.slice(n.index+1)}}return o+i+o}function a(){return`$`}}var jg={tokenize:Ng,concrete:!0,name:`mathFlow`},Mg={tokenize:Pg,partial:!0};function Ng(t,n,r){let i=this,a=i.events[i.events.length-1],o=a&&a[1].type===`linePrefix`?a[2].sliceSerialize(a[1],!0).length:0,s=0;return c;function c(e){return t.enter(`mathFlow`),t.enter(`mathFlowFence`),t.enter(`mathFlowFenceSequence`),l(e)}function l(n){return n===36?(t.consume(n),s++,l):s<2?r(n):(t.exit(`mathFlowFenceSequence`),e.rt(t,u,`whitespace`)(n))}function u(n){return n===null||e.st(n)?f(n):(t.enter(`mathFlowFenceMeta`),t.enter(`chunkString`,{contentType:`string`}),d(n))}function d(n){return n===null||e.st(n)?(t.exit(`chunkString`),t.exit(`mathFlowFenceMeta`),f(n)):n===36?r(n):(t.consume(n),d)}function f(e){return t.exit(`mathFlowFence`),i.interrupt?n(e):t.attempt(Mg,p,_)(e)}function p(e){return t.attempt({tokenize:v,partial:!0},_,m)(e)}function m(n){return(o?e.rt(t,h,`linePrefix`,o+1):h)(n)}function h(n){return n===null?_(n):e.st(n)?t.attempt(Mg,p,_)(n):(t.enter(`mathFlowValue`),g(n))}function g(n){return n===null||e.st(n)?(t.exit(`mathFlowValue`),h(n)):(t.consume(n),g)}function _(e){return t.exit(`mathFlow`),n(e)}function v(t,n,r){let a=0;return e.rt(t,o,`linePrefix`,i.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function o(e){return t.enter(`mathFlowFence`),t.enter(`mathFlowFenceSequence`),c(e)}function c(n){return n===36?(a++,t.consume(n),c):a<s?r(n):(t.exit(`mathFlowFenceSequence`),e.rt(t,l,`whitespace`)(n))}function l(i){return i===null||e.st(i)?(t.exit(`mathFlowFence`),n(i)):r(i)}}}function Pg(e,t,n){let r=this;return i;function i(n){return n===null?t(n):(e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Fg(t){let n=(t||{}).singleDollarTextMath;return n??=!0,{tokenize:r,resolve:Ig,previous:Lg,name:`mathText`};function r(t,r,i){let a=0,o,s;return c;function c(e){return t.enter(`mathText`),t.enter(`mathTextSequence`),l(e)}function l(e){return e===36?(t.consume(e),a++,l):a<2&&!n?i(e):(t.exit(`mathTextSequence`),u(e))}function u(n){return n===null?i(n):n===36?(s=t.enter(`mathTextSequence`),o=0,f(n)):n===32?(t.enter(`space`),t.consume(n),t.exit(`space`),u):e.st(n)?(t.enter(`lineEnding`),t.consume(n),t.exit(`lineEnding`),u):(t.enter(`mathTextData`),d(n))}function d(n){return n===null||n===32||n===36||e.st(n)?(t.exit(`mathTextData`),u(n)):(t.consume(n),d)}function f(e){return e===36?(t.consume(e),o++,f):o===a?(t.exit(`mathTextSequence`),t.exit(`mathText`),r(e)):(s.type=`mathTextData`,d(e))}}}function Ig(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`mathTextData`){e[t][1].type=`mathTextPadding`,e[n][1].type=`mathTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`mathTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Lg(e){return e!==36||this.events[this.events.length-1][1].type===`characterEscape`}function Rg(e){return{flow:{36:jg},text:{36:Fg(e)}}}var zg={};function Bg(e){let t=this,n=e||zg,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Rg(n)),a.push(kg()),o.push(Ag(n))}var Vg=`math_inline`,Hg=`math_block`,Ug=/(?:\$)([^$]+)(?:\$)$/,Wg=/^\$\$\s$/,Gg=r.d(`remarkMath`,()=>Bg),Kg=r.n({},`katexOptions`),qg=r.c(Vg,e=>({group:`inline`,inline:!0,atom:!0,attrs:{value:{default:``}},parseDOM:[{tag:`span[data-type="${Vg}"]`,getAttrs:e=>{let t=e;return{value:t.dataset.value??t.textContent??``}}}],toDOM:t=>{let n=String(t.attrs.value??t.textContent??``),r=document.createElement(`span`);return r.dataset.type=Vg,r.dataset.value=n,Hh.render(n,r,e.get(Kg.key)),r},parseMarkdown:{match:e=>e.type===`inlineMath`,runner:(e,t,n)=>{let r=String(t.value??``);e.addNode(n,{value:r})}},toMarkdown:{match:e=>e.type.name===Vg,runner:(e,t)=>{let n=String(t.attrs.value??t.textContent??``);e.addNode(`inlineMath`,void 0,n)}}})),Jg=r.c(Hg,e=>({content:`text*`,group:`block`,marks:``,defining:!0,atom:!0,isolating:!0,attrs:{value:{default:``}},parseDOM:[{tag:`div[data-type="${Hg}"]`,preserveWhitespace:`full`,getAttrs:e=>({value:e.dataset.value??``})}],toDOM:t=>{let n=String(t.attrs.value??``),r=document.createElement(`div`);return r.dataset.type=Hg,r.dataset.value=n,Hh.render(n,r,e.get(Kg.key)),r},parseMarkdown:{match:e=>e.type===`math`,runner:(e,t,n)=>{let r=String(t.value??``);e.addNode(n,{value:r})}},toMarkdown:{match:e=>e.type.name===Hg,runner:(e,t)=>{let n=String(t.attrs.value??``);e.addNode(`math`,void 0,n)}}})),Yg=r.r(t=>new e.W(Ug,(e,n,r,i)=>{let a=qg.type(t),o=n[1]??``,s=e.doc.resolve(r);return s.parent.canReplaceWith(s.index(),s.indexAfter(),a)?e.tr.replaceWith(r,i,a.create({value:o})):null})),Xg=[Gg,Kg,qg,Jg,r.r(t=>new e.W(Wg,(e,n,r,i)=>{let a=e.doc.resolve(r),o=Jg.type(t);return a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),o)?e.tr.delete(r,i).setBlockType(r,r,o):null})),Yg].flat(),Zg=`blockquote`,Qg=`paragraph`,$g=`Backspace`,e_=e=>e.key!==$g||e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey,t_=e=>{if(e.parent.type.name!==Qg||e.parentOffset!==0)return null;for(let t=e.depth;t>0;--t){let n=e.node(t);if(n.type.name!==Zg)continue;let r=e.depth,i=e.index(t);return r<=t||i!==0?null:{paragraphDepth:r,blockquoteDepth:t,blockquoteType:n.type}}return null},n_=(e,n)=>{let{selection:r}=e.state;if(!r.empty)return!1;let i=r.$from,a=t_(i);if(!a)return!1;let o=i.blockRange(i,e=>e.type===a.blockquoteType);if(!o)return!1;let s=t.b(o);if(s===null)return!1;n.preventDefault();let c=e.state.tr.lift(o,s).scrollIntoView();return e.dispatch(c),!0},r_=r.u(()=>new t.i({key:new t.a(`zt-md-blockquote-backspace-lift`),props:{handleKeyDown:(e,t)=>e_(t)?!1:n_(e,t)}})),i_=`code_block`,a_=1200,o_=e=>(0,d.renderToStaticMarkup)((0,u.createElement)(e,{size:14,strokeWidth:2,"aria-hidden":`true`})),s_=o_(Oe),c_=o_(Se),l_=o_(nt),u_=e=>typeof e==`function`?e():null,d_=e=>typeof e.props.editable==`function`?e.props.editable(e.state):e.editable,f_=class{syncLanguageAttribute(e){let t=typeof e.attrs.language==`string`?e.attrs.language.trim():``;if(!t){this.contentDOM.removeAttribute(`data-language`);return}this.contentDOM.setAttribute(`data-language`,t)}constructor(e,t,n,r){this.copyFeedbackTimer=null,this.handleCopyClick=e=>{if(e.preventDefault(),e.stopPropagation(),!d_(this.view))return;let t=this.node.textContent;(typeof navigator<`u`&&navigator.clipboard?.writeText?navigator.clipboard.writeText(t):Promise.resolve()).then(()=>{this.copyButton.innerHTML=c_,this.copyButton.dataset.copied=`true`,this.copyFeedbackTimer!==null&&clearTimeout(this.copyFeedbackTimer),this.copyFeedbackTimer=setTimeout(()=>{this.copyButton.innerHTML=s_,delete this.copyButton.dataset.copied,this.copyFeedbackTimer=null},a_)}).catch(()=>{})},this.handleDeleteClick=e=>{e.preventDefault(),e.stopPropagation(),d_(this.view)&&this.deleteCurrentCodeBlock()},this.node=e,this.view=t,this.getPos=n,this.dom=document.createElement(`div`),this.dom.className=`zt-md-code-block`,this.dom.dataset.type=i_,this.updateEditableState(),this.contentDOM=document.createElement(`pre`),this.actionsContainer=document.createElement(`span`),this.actionsContainer.className=`zt-md-code-block-actions`,this.copyButton=document.createElement(`button`),this.copyButton.type=`button`,this.copyButton.className=`zt-md-code-block-action-button`,this.copyButton.setAttribute(`aria-label`,r.codeBlockCopyAriaLabel),this.copyButton.innerHTML=s_,this.deleteButton=document.createElement(`button`),this.deleteButton.type=`button`,this.deleteButton.className=`zt-md-code-block-action-button zt-md-code-block-action-button-danger`,this.deleteButton.setAttribute(`aria-label`,r.codeBlockDeleteAriaLabel),this.deleteButton.innerHTML=l_,this.actionsContainer.append(this.copyButton,this.deleteButton),this.dom.append(this.contentDOM,this.actionsContainer),this.syncLanguageAttribute(e),this.copyButton.addEventListener(`click`,this.handleCopyClick),this.deleteButton.addEventListener(`click`,this.handleDeleteClick)}deleteCurrentCodeBlock(){let e=u_(this.getPos);if(e===null)return;let n=this.view.state.tr.delete(e,e+this.node.nodeSize),r=Math.min(e,n.doc.content.size);n.setSelection(t.c.near(n.doc.resolve(r),-1)).scrollIntoView(),this.view.dispatch(n),requestAnimationFrame(()=>{this.view.focus()})}updateEditableState(){this.dom.dataset.editable=d_(this.view)?`true`:`false`}update(e){return e.type.name===i_?(this.node=e,this.updateEditableState(),this.syncLanguageAttribute(e),!0):!1}stopEvent(e){let t=e.target;return t instanceof Node?this.actionsContainer.contains(t):!1}ignoreMutation(e){return e.type===`selection`?!1:this.actionsContainer.contains(e.target)}destroy(){this.copyButton.removeEventListener(`click`,this.handleCopyClick),this.deleteButton.removeEventListener(`click`,this.handleDeleteClick),this.copyFeedbackTimer!==null&&(clearTimeout(this.copyFeedbackTimer),this.copyFeedbackTimer=null),this.copyButton.innerHTML=s_,delete this.copyButton.dataset.copied}},p_=(e=cn())=>(t,n,r)=>new f_(t,n,typeof r==`function`?()=>{let e=r();return typeof e==`number`?e:0}:!1,e);m_.displayName=`clike`,m_.aliases=[];function m_(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}h_.displayName=`c`,h_.aliases=[];function h_(e){e.register(m_),e.languages.c=e.languages.extend(`clike`,{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),e.languages.insertBefore(`c`,`string`,{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),e.languages.insertBefore(`c`,`string`,{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:`property`,inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},e.languages.c.string],char:e.languages.c.char,comment:e.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:`function`}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:`keyword`},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:e.languages.c}}}}),e.languages.insertBefore(`c`,`function`,{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete e.languages.c.boolean}g_.displayName=`cpp`,g_.aliases=[];function g_(e){e.register(h_),(function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=`\\b(?!<keyword>)\\w+(?:\\s*\\.\\s*\\w+)*\\b`.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend(`c`,{"class-name":[{pattern:RegExp(`(\\b(?:class|concept|enum|struct|typename)\\s+)(?!<keyword>)\\w+`.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore(`cpp`,`string`,{module:{pattern:RegExp(`(\\b(?:import|module)\\s+)(?:"(?:\\\\(?:\\r\\n|[\\s\\S])|[^"\\\\\\r\\n])*"|<[^<>\\r\\n]*>|`+`<mod-name>(?:\\s*:\\s*<mod-name>)?|:\\s*<mod-name>`.replace(/<mod-name>/g,function(){return n})+`)`),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:`string`,greedy:!0}}),e.languages.insertBefore(`cpp`,`keyword`,{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:e.languages.cpp}}}}),e.languages.insertBefore(`cpp`,`operator`,{"double-colon":{pattern:/::/,alias:`punctuation`}}),e.languages.insertBefore(`cpp`,`class-name`,{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend(`cpp`,{})}}),e.languages.insertBefore(`inside`,`double-colon`,{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp[`base-clause`])})(e)}__.displayName=`arduino`,__.aliases=[`ino`];function __(e){e.register(g_),e.languages.arduino=e.languages.extend(`cpp`,{keyword:/\b(?:String|array|bool|boolean|break|byte|case|catch|continue|default|do|double|else|finally|for|function|goto|if|in|instanceof|int|integer|long|loop|new|null|return|setup|string|switch|throw|try|void|while|word)\b/,constant:/\b(?:ANALOG_MESSAGE|DEFAULT|DIGITAL_MESSAGE|EXTERNAL|FIRMATA_STRING|HIGH|INPUT|INPUT_PULLUP|INTERNAL|INTERNAL1V1|INTERNAL2V56|LED_BUILTIN|LOW|OUTPUT|REPORT_ANALOG|REPORT_DIGITAL|SET_PIN_MODE|SYSEX_START|SYSTEM_RESET)\b/,builtin:/\b(?:Audio|BSSID|Bridge|Client|Console|EEPROM|Esplora|EsploraTFT|Ethernet|EthernetClient|EthernetServer|EthernetUDP|File|FileIO|FileSystem|Firmata|GPRS|GSM|GSMBand|GSMClient|GSMModem|GSMPIN|GSMScanner|GSMServer|GSMVoiceCall|GSM_SMS|HttpClient|IPAddress|IRread|Keyboard|KeyboardController|LiquidCrystal|LiquidCrystal_I2C|Mailbox|Mouse|MouseController|PImage|Process|RSSI|RobotControl|RobotMotor|SD|SPI|SSID|Scheduler|Serial|Server|Servo|SoftwareSerial|Stepper|Stream|TFT|Task|USBHost|WiFi|WiFiClient|WiFiServer|WiFiUDP|Wire|YunClient|YunServer|abs|addParameter|analogRead|analogReadResolution|analogReference|analogWrite|analogWriteResolution|answerCall|attach|attachGPRS|attachInterrupt|attached|autoscroll|available|background|beep|begin|beginPacket|beginSD|beginSMS|beginSpeaker|beginTFT|beginTransmission|beginWrite|bit|bitClear|bitRead|bitSet|bitWrite|blink|blinkVersion|buffer|changePIN|checkPIN|checkPUK|checkReg|circle|cityNameRead|cityNameWrite|clear|clearScreen|click|close|compassRead|config|connect|connected|constrain|cos|countryNameRead|countryNameWrite|createChar|cursor|debugPrint|delay|delayMicroseconds|detach|detachInterrupt|digitalRead|digitalWrite|disconnect|display|displayLogos|drawBMP|drawCompass|encryptionType|end|endPacket|endSMS|endTransmission|endWrite|exists|exitValue|fill|find|findUntil|flush|gatewayIP|get|getAsynchronously|getBand|getButton|getCurrentCarrier|getIMEI|getKey|getModifiers|getOemKey|getPINUsed|getResult|getSignalStrength|getSocket|getVoiceCallStatus|getXChange|getYChange|hangCall|height|highByte|home|image|interrupts|isActionDone|isDirectory|isListening|isPIN|isPressed|isValid|keyPressed|keyReleased|keyboardRead|knobRead|leftToRight|line|lineFollowConfig|listen|listenOnLocalhost|loadImage|localIP|lowByte|macAddress|maintain|map|max|messageAvailable|micros|millis|min|mkdir|motorsStop|motorsWrite|mouseDragged|mouseMoved|mousePressed|mouseReleased|move|noAutoscroll|noBlink|noBuffer|noCursor|noDisplay|noFill|noInterrupts|noListenOnLocalhost|noStroke|noTone|onReceive|onRequest|open|openNextFile|overflow|parseCommand|parseFloat|parseInt|parsePacket|pauseMode|peek|pinMode|playFile|playMelody|point|pointTo|position|pow|prepare|press|print|printFirmwareVersion|printVersion|println|process|processInput|pulseIn|put|random|randomSeed|read|readAccelerometer|readBlue|readButton|readBytes|readBytesUntil|readGreen|readJoystickButton|readJoystickSwitch|readJoystickX|readJoystickY|readLightSensor|readMessage|readMicrophone|readNetworks|readRed|readSlider|readString|readStringUntil|readTemperature|ready|rect|release|releaseAll|remoteIP|remoteNumber|remotePort|remove|requestFrom|retrieveCallingNumber|rewindDirectory|rightToLeft|rmdir|robotNameRead|robotNameWrite|run|runAsynchronously|runShellCommand|runShellCommandAsynchronously|running|scanNetworks|scrollDisplayLeft|scrollDisplayRight|seek|sendAnalog|sendDigitalPortPair|sendDigitalPorts|sendString|sendSysex|serialEvent|setBand|setBitOrder|setClockDivider|setCursor|setDNS|setDataMode|setFirmwareVersion|setMode|setPINUsed|setSpeed|setTextSize|setTimeout|shiftIn|shiftOut|shutdown|sin|size|sqrt|startLoop|step|stop|stroke|subnetMask|switchPIN|tan|tempoWrite|text|tone|transfer|tuneWrite|turn|updateIR|userNameRead|userNameWrite|voiceCall|waitContinue|width|write|writeBlue|writeGreen|writeJSON|writeMessage|writeMicroseconds|writeRGB|writeRed|yield)\b/}),e.languages.ino=e.languages.arduino}v_.displayName=`bash`,v_.aliases=[`sh`,`shell`];function v_(e){(function(e){var t=`\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b`,n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:`punctuation`,inside:null},r={bash:n,environment:{pattern:RegExp(`\\$`+t),alias:`constant`},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp(`(\\{)`+t),lookbehind:!0,alias:`constant`}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:`important`},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:`function`},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:`function`}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:`variable`,lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp(`(^|[\\s;|&]|[<>]\\()`+t),lookbehind:!0,alias:`constant`}},alias:`variable`,lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:`variable`,lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp(`\\$?`+t),alias:`constant`},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:`class-name`},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:`important`},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:`important`}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var i=[`comment`,`function-name`,`for-or-select`,`assign-left`,`parameter`,`string`,`environment`,`function`,`keyword`,`builtin`,`boolean`,`file-descriptor`,`operator`,`punctuation`,`number`],a=r.variable[1].inside,o=0;o<i.length;o++)a[i[o]]=e.languages.bash[i[o]];e.languages.sh=e.languages.bash,e.languages.shell=e.languages.bash})(e)}y_.displayName=`csharp`,y_.aliases=[`cs`,`dotnet`];function y_(e){e.register(m_),(function(e){function t(e,t){return e.replace(/<<(\d+)>>/g,function(e,n){return`(?:`+t[+n]+`)`})}function n(e,n,r){return RegExp(t(e,n),r||``)}function r(e,t){for(var n=0;n<t;n++)e=e.replace(/<<self>>/g,function(){return`(?:`+e+`)`});return e.replace(/<<self>>/g,`[^\\s\\S]`)}var i={type:`bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void`,typeDeclaration:`class enum interface record struct`,contextual:`add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)`,other:`abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield`};function a(e){return`\\b(?:`+e.trim().replace(/ /g,`|`)+`)\\b`}var o=a(i.typeDeclaration),s=RegExp(a(i.type+` `+i.typeDeclaration+` `+i.contextual+` `+i.other)),c=a(i.typeDeclaration+` `+i.contextual+` `+i.other),l=a(i.type+` `+i.typeDeclaration+` `+i.other),u=r(`<(?:[^<>;=+\\-*/%&|^]|<<self>>)*>`,2),d=r(`\\((?:[^()]|<<self>>)*\\)`,2),f=`@?\\b[A-Za-z_]\\w*\\b`,p=t(`<<0>>(?:\\s*<<1>>)?`,[f,u]),m=t(`(?!<<0>>)<<1>>(?:\\s*\\.\\s*<<1>>)*`,[c,p]),h=`\\[\\s*(?:,\\s*)*\\]`,g=t(`<<0>>(?:\\s*(?:\\?\\s*)?<<1>>)*(?:\\s*\\?)?`,[m,h]),_=t(`(?:<<0>>|<<1>>)(?:\\s*(?:\\?\\s*)?<<2>>)*(?:\\s*\\?)?`,[t(`\\(<<0>>+(?:,<<0>>+)+\\)`,[t(`[^,()<>[\\];=+\\-*/%&|^]|<<0>>|<<1>>|<<2>>`,[u,d,h])]),m,h]),v={keyword:s,punctuation:/[<>()?,.:[\]]/},y=`'(?:[^\\r\\n'\\\\]|\\\\.|\\\\[Uux][\\da-fA-F]{1,8})'`,b=`"(?:\\\\.|[^\\\\"\\r\\n])*"`,x=`@"(?:""|\\\\[\\s\\S]|[^\\\\"])*"(?!")`;e.languages.csharp=e.languages.extend(`clike`,{string:[{pattern:n(`(^|[^$\\\\])<<0>>`,[x]),lookbehind:!0,greedy:!0},{pattern:n(`(^|[^@$\\\\])<<0>>`,[b]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:n(`(\\busing\\s+static\\s+)<<0>>(?=\\s*;)`,[m]),lookbehind:!0,inside:v},{pattern:n(`(\\busing\\s+<<0>>\\s*=\\s*)<<1>>(?=\\s*;)`,[f,_]),lookbehind:!0,inside:v},{pattern:n(`(\\busing\\s+)<<0>>(?=\\s*=)`,[f]),lookbehind:!0},{pattern:n(`(\\b<<0>>\\s+)<<1>>`,[o,p]),lookbehind:!0,inside:v},{pattern:n(`(\\bcatch\\s*\\(\\s*)<<0>>`,[m]),lookbehind:!0,inside:v},{pattern:n(`(\\bwhere\\s+)<<0>>`,[f]),lookbehind:!0},{pattern:n(`(\\b(?:is(?:\\s+not)?|as)\\s+)<<0>>`,[g]),lookbehind:!0,inside:v},{pattern:n(`\\b<<0>>(?=\\s+(?!<<1>>|with\\s*\\{)<<2>>(?:\\s*[=,;:{)\\]]|\\s+(?:in|when)\\b))`,[_,l,f]),inside:v}],keyword:s,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),e.languages.insertBefore(`csharp`,`number`,{range:{pattern:/\.\./,alias:`operator`}}),e.languages.insertBefore(`csharp`,`punctuation`,{"named-parameter":{pattern:n(`([(,]\\s*)<<0>>(?=\\s*:)`,[f]),lookbehind:!0,alias:`punctuation`}}),e.languages.insertBefore(`csharp`,`class-name`,{namespace:{pattern:n(`(\\b(?:namespace|using)\\s+)<<0>>(?:\\s*\\.\\s*<<0>>)*(?=\\s*[;{])`,[f]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:n(`(\\b(?:default|sizeof|typeof)\\s*\\(\\s*(?!\\s))(?:[^()\\s]|\\s(?!\\s)|<<0>>)*(?=\\s*\\))`,[d]),lookbehind:!0,alias:`class-name`,inside:v},"return-type":{pattern:n(`<<0>>(?=\\s+(?:<<1>>\\s*(?:=>|[({]|\\.\\s*this\\s*\\[)|this\\s*\\[))`,[_,m]),inside:v,alias:`class-name`},"constructor-invocation":{pattern:n(`(\\bnew\\s+)<<0>>(?=\\s*[[({])`,[_]),lookbehind:!0,inside:v,alias:`class-name`},"generic-method":{pattern:n(`<<0>>\\s*<<1>>(?=\\s*\\()`,[f,u]),inside:{function:n(`^<<0>>`,[f]),generic:{pattern:RegExp(u),alias:`class-name`,inside:v}}},"type-list":{pattern:n(`\\b((?:<<0>>\\s+<<1>>|record\\s+<<1>>\\s*<<5>>|where\\s+<<2>>)\\s*:\\s*)(?:<<3>>|<<4>>|<<1>>\\s*<<5>>|<<6>>)(?:\\s*,\\s*(?:<<3>>|<<4>>|<<6>>))*(?=\\s*(?:where|[{;]|=>|$))`,[o,p,f,_,s.source,d,`\\bnew\\s*\\(\\s*\\)`]),lookbehind:!0,inside:{"record-arguments":{pattern:n(`(^(?!new\\s*\\()<<0>>\\s*)<<1>>`,[p,d]),lookbehind:!0,greedy:!0,inside:e.languages.csharp},keyword:s,"class-name":{pattern:RegExp(_),greedy:!0,inside:v},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:`property`,inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:`keyword`}}}});var S=b+`|`+y,C=t(`\\/(?![*/])|\\/\\/[^\\r\\n]*[\\r\\n]|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/|<<0>>`,[S]),w=r(t(`[^"'/()]|<<0>>|\\(<<self>>*\\)`,[C]),2),T=`\\b(?:assembly|event|field|method|module|param|property|return|type)\\b`,E=t(`<<0>>(?:\\s*\\(<<1>>*\\))?`,[m,w]);e.languages.insertBefore(`csharp`,`class-name`,{attribute:{pattern:n(`((?:^|[^\\s\\w>)?])\\s*\\[\\s*)(?:<<0>>\\s*:\\s*)?<<1>>(?:\\s*,\\s*<<1>>)*(?=\\s*\\])`,[T,E]),lookbehind:!0,greedy:!0,inside:{target:{pattern:n(`^<<0>>(?=\\s*:)`,[T]),alias:`keyword`},"attribute-arguments":{pattern:n(`\\(<<0>>*\\)`,[w]),inside:e.languages.csharp},"class-name":{pattern:RegExp(m),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var ee=`:[^}\\r\\n]+`,te=r(t(`[^"'/()]|<<0>>|\\(<<self>>*\\)`,[C]),2),D=t(`\\{(?!\\{)(?:(?![}:])<<0>>)*<<1>>?\\}`,[te,ee]),ne=r(t(`[^"'/()]|\\/(?!\\*)|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/|<<0>>|\\(<<self>>*\\)`,[S]),2),re=t(`\\{(?!\\{)(?:(?![}:])<<0>>)*<<1>>?\\}`,[ne,ee]);function ie(t,r){return{interpolation:{pattern:n(`((?:^|[^{])(?:\\{\\{)*)<<0>>`,[t]),lookbehind:!0,inside:{"format-string":{pattern:n(`(^\\{(?:(?![}:])<<0>>)*)<<1>>(?=\\}$)`,[r,ee]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:`language-csharp`,inside:e.languages.csharp}}},string:/[\s\S]+/}}e.languages.insertBefore(`csharp`,`string`,{"interpolation-string":[{pattern:n(`(^|[^\\\\])(?:\\$@|@\\$)"(?:""|\\\\[\\s\\S]|\\{\\{|<<0>>|[^\\\\{"])*"`,[D]),lookbehind:!0,greedy:!0,inside:ie(D,te)},{pattern:n(`(^|[^@\\\\])\\$"(?:\\\\.|\\{\\{|<<0>>|[^\\\\"{])*"`,[re]),lookbehind:!0,greedy:!0,inside:ie(re,ne)}],char:{pattern:RegExp(y),greedy:!0}}),e.languages.dotnet=e.languages.cs=e.languages.csharp})(e)}b_.displayName=`markup`,b_.aliases=[`atom`,`html`,`mathml`,`rss`,`ssml`,`svg`,`xml`];function b_(e){e.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:`attr-equals`},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:`named-entity`},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside[`attr-value`].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside[`internal-subset`].inside=e.languages.markup,e.hooks.add(`wrap`,function(e){e.type===`entity`&&(e.attributes.title=e.content.value.replace(/&/,`&`))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(t,n){var r={};r[`language-`+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:e.languages[n]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};i[`language-`+n]={pattern:/[\s\S]+/,inside:e.languages[n]};var a={};a[t]={pattern:RegExp(`(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)`.replace(/__/g,function(){return t}),`i`),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore(`markup`,`cdata`,a)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(t,n){e.languages.markup.tag.inside[`special-attr`].push({pattern:RegExp(`(^|["'\\s])(?:`+t+`)\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s'">=]+(?=[\\s>]))`,`i`),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,`language-`+n],inside:e.languages[n]},punctuation:[{pattern:/^=/,alias:`attr-equals`},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend(`markup`,{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}x_.displayName=`css`,x_.aliases=[];function x_(e){(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp(`@[\\w-](?:[^;{\\s"']|\\s+(?!\\s)|`+t.source+`)*?(?:;|(?=\\s*\\{))`),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:`selector`},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp(`\\burl\\((?:`+t.source+`|(?:[^\\\\\\r\\n()"']|\\\\[\\s\\S])*)\\)`,`i`),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp(`^`+t.source+`$`),alias:`url`}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+`)*(?=\\s*\\{)`),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined(`style`,`css`),n.tag.addAttribute(`style`,`css`))})(e)}S_.displayName=`diff`,S_.aliases=[];function S_(e){(function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":`-`,"deleted-arrow":`<`,"inserted-sign":`+`,"inserted-arrow":`>`,unchanged:` `,diff:`!`};Object.keys(t).forEach(function(n){var r=t[n],i=[];/^\w+$/.test(n)||i.push(/\w+/.exec(n)[0]),n===`diff`&&i.push(`bold`),e.languages.diff[n]={pattern:RegExp(`^(?:[`+r+`].*(?:\r
|
|
355
|
+
`);if(!(e.key===`ArrowUp`&&o||e.key===`ArrowDown`&&s))return;let c=KU(this.getPos);if(c===null)return;e.preventDefault();let l=e.key===`ArrowUp`?c:Math.min(c+this.node.nodeSize,this.view.state.doc.content.size),u=e.key===`ArrowUp`?-1:1,d=this.view.state.tr.setSelection(this.createBoundarySelection(l,u)).scrollIntoView();this.view.dispatch(d),this.view.focus()},this.handleBlur=()=>{this.isDeletingByBackspace||this.exitEditMode()},this.node=e,this.view=t,this.getPos=n,this.messages=r,this.dom=document.createElement(`div`),this.dom.dataset.type=BU,this.dom.className=`zt-md-math-block`,this.syncEditableState(),this.sourceContainer=document.createElement(`div`),this.sourceContainer.className=`zt-md-math-block-source`,this.sourceContainer.hidden=!0,this.sourceTextarea=document.createElement(`textarea`),this.sourceTextarea.className=`zt-md-math-block-textarea`,this.sourceTextarea.setAttribute(`aria-label`,this.messages.mathBlockSourceAriaLabel),this.sourceTextarea.spellcheck=!1,this.previewContainer=document.createElement(`div`),this.previewContainer.className=`zt-md-math-block-preview`,this.actionsContainer=document.createElement(`div`),this.actionsContainer.className=`zt-md-math-block-actions`,this.copyButton=document.createElement(`button`),this.copyButton.type=`button`,this.copyButton.className=`zt-md-math-block-action-button`,this.copyButton.setAttribute(`aria-label`,this.messages.mathBlockCopyAriaLabel),this.copyButton.innerHTML=WU,this.deleteButton=document.createElement(`button`),this.deleteButton.type=`button`,this.deleteButton.className=`zt-md-math-block-action-button zt-md-math-block-action-button-danger`,this.deleteButton.setAttribute(`aria-label`,this.messages.mathBlockDeleteAriaLabel),this.deleteButton.innerHTML=UU($E),this.errorContainer=document.createElement(`div`),this.errorContainer.className=`zt-md-math-block-error`,this.errorContainer.hidden=!0,this.actionsContainer.append(this.copyButton,this.deleteButton),this.sourceContainer.appendChild(this.sourceTextarea),this.previewContainer.appendChild(this.errorContainer),this.dom.append(this.actionsContainer,this.sourceContainer,this.previewContainer),this.syncFromNode(e),this.dom.addEventListener(`click`,this.handleClick),this.dom.addEventListener(`pointerdown`,this.handlePointerDown),this.dom.addEventListener(`pointermove`,this.handlePointerMove),this.dom.addEventListener(`pointerup`,this.handlePointerUp),this.dom.addEventListener(`pointercancel`,this.handlePointerUp),this.copyButton.addEventListener(`click`,this.handleCopyClick),this.deleteButton.addEventListener(`click`,this.handleDeleteClick),this.sourceTextarea.addEventListener(`input`,this.handleInput),this.sourceTextarea.addEventListener(`keydown`,this.handleKeyDown),this.sourceTextarea.addEventListener(`blur`,this.handleBlur)}deleteCurrentMathBlock(){let e=KU(this.getPos);if(e===null)return;this.isDeletingByBackspace=!0;let t=this.view.state.tr.delete(e,e+this.node.nodeSize),n=Math.min(e,t.doc.content.size);t.setSelection(M.near(t.doc.resolve(n),-1)).scrollIntoView(),this.view.dispatch(t),requestAnimationFrame(()=>{this.view.focus(),this.isDeletingByBackspace=!1})}createBoundarySelection(e,t){let n=this.view.state.doc.resolve(e);return XT.valid(n)?new XT(n):M.near(n,t)}syncFromNode(e){let t=typeof e.attrs.value==`string`?e.attrs.value:``;this.dom.dataset.value=t,this.sourceTextarea.value=t,this.renderMath(t)}renderMath(e){this.errorContainer.hidden=!0,this.errorContainer.textContent=``;try{zU.render(e,this.previewContainer,{displayMode:!0,throwOnError:!0}),this.previewContainer.appendChild(this.errorContainer)}catch{this.previewContainer.textContent=e,this.errorContainer.hidden=!1,this.errorContainer.textContent=this.messages.mathRenderError,this.previewContainer.appendChild(this.errorContainer)}}enterEditMode(){qU(this.view)&&(this.sourceContainer.hidden=!1,this.dom.classList.add(`zt-md-math-block-editing`),this.sourceTextarea.focus())}exitEditMode(){this.sourceContainer.hidden=!0,this.dom.classList.remove(`zt-md-math-block-editing`)}update(e){return e.type.name===BU?(this.node=e,this.syncEditableState(),this.syncFromNode(e),!0):!1}selectNode(){this.enterEditMode()}deselectNode(){this.exitEditMode()}stopEvent(e){let t=e.target;return t instanceof Node?this.sourceContainer.contains(t)||this.actionsContainer.contains(t):!1}ignoreMutation(){return!0}destroy(){this.dom.removeEventListener(`click`,this.handleClick),this.dom.removeEventListener(`pointerdown`,this.handlePointerDown),this.dom.removeEventListener(`pointermove`,this.handlePointerMove),this.dom.removeEventListener(`pointerup`,this.handlePointerUp),this.dom.removeEventListener(`pointercancel`,this.handlePointerUp),this.copyButton.removeEventListener(`click`,this.handleCopyClick),this.deleteButton.removeEventListener(`click`,this.handleDeleteClick),this.sourceTextarea.removeEventListener(`input`,this.handleInput),this.sourceTextarea.removeEventListener(`keydown`,this.handleKeyDown),this.sourceTextarea.removeEventListener(`blur`,this.handleBlur),this.copyFeedbackTimer!==null&&(clearTimeout(this.copyFeedbackTimer),this.copyFeedbackTimer=null),this.copyButton.innerHTML=WU,delete this.copyButton.dataset.copied}},YU=(e=aO())=>(t,n,r)=>new JU(t,n,typeof r==`function`?()=>{let e=r();return typeof e==`number`?e:0}:!1,e),XU=`math_inline`,ZU=new nl(`zt-md-math-inline-edit`),QU=e=>typeof e.props.editable==`function`?e.props.editable(e.state):e.editable,$U=e=>e?.type.name===XU,eW=e=>String(e.attrs.value??e.textContent??``),tW=(e,t,n)=>{QU(e)&&e.dispatch(e.state.tr.setMeta(ZU,{type:`open`,position:t,caret:n?.caret===`start`?`start`:`end`}))},nW=class{createSafeTextSelection(e,t){try{return M.create(e,t)}catch{return M.near(e.resolve(t),-1)}}resolveArrowExitTarget(e){if(this.currentPosition===null)return null;let t=this.resolveCurrentNode();if(!t)return null;let n=this.sourceInput.selectionStart,r=this.sourceInput.selectionEnd;if(n===null||r===null||n!==r)return null;if(e.key===`ArrowLeft`&&n===0||e.key===`ArrowUp`)return this.currentPosition;let i=this.sourceInput.value.length;return e.key===`ArrowRight`&&n===i||e.key===`ArrowDown`?this.currentPosition+t.nodeSize:null}shouldDeleteMathInlineOnBackspace(e){if(e.key!==`Backspace`||this.currentPosition===null)return!1;let t=this.sourceInput.selectionStart,n=this.sourceInput.selectionEnd;return t===null||n===null||t!==0||n!==0?!1:!!this.resolveCurrentNode()}deleteCurrentMathInlineAndFocusEditor(){if(this.currentPosition===null)return;let e=this.resolveCurrentNode();if(!e){this.closeEditor(!1);return}let t=this.currentPosition,n=this.currentPosition+e.nodeSize,r=this.view.state.tr.delete(t,n);r.setSelection(this.createSafeTextSelection(r.doc,t)).setMeta(ZU,{type:`close`}).scrollIntoView(),this.view.dispatch(r),this.view.focus()}constructor(e,t){this.currentPosition=null,this.currentMathInlineElement=null,this.isCommitting=!1,this.currentCaret=`end`,this.handleMouseDown=e=>{e.stopPropagation()},this.handleBeforeInput=e=>{e.stopPropagation()},this.handleInput=e=>{e.stopPropagation(),this.renderMath(this.sourceInput.value)},this.handleKeyDown=e=>{if(e.stopPropagation(),this.shouldDeleteMathInlineOnBackspace(e)){e.preventDefault(),this.deleteCurrentMathInlineAndFocusEditor();return}let t=this.resolveArrowExitTarget(e);if(t!==null){e.preventDefault(),this.commitCurrentValue(t);return}if(e.key===`Enter`){e.preventDefault(),this.commitCurrentValue();return}e.key===`Escape`&&(e.preventDefault(),this.closeEditor(!0))},this.handleBlur=()=>{this.isCommitting||this.currentPosition===null||this.commitCurrentValue()},this.view=e,this.messages=t,this.host=document.createElement(`span`),this.host.className=`zt-md-math-inline-editor`,this.host.style.display=`none`,this.sourceInput=document.createElement(`input`),this.sourceInput.type=`text`,this.sourceInput.className=`zt-md-math-inline-editor-input`,this.sourceInput.setAttribute(`aria-label`,this.messages.mathBlockSourceAriaLabel),this.sourceInput.spellcheck=!1,this.previewContainer=document.createElement(`span`),this.previewContainer.className=`zt-md-math-inline-editor-preview`,this.errorContainer=document.createElement(`span`),this.errorContainer.className=`zt-md-math-inline-editor-error`,this.errorContainer.hidden=!0,this.host.append(this.sourceInput,this.previewContainer,this.errorContainer),this.sourceInput.addEventListener(`input`,this.handleInput),this.sourceInput.addEventListener(`beforeinput`,this.handleBeforeInput),this.sourceInput.addEventListener(`keydown`,this.handleKeyDown),this.sourceInput.addEventListener(`blur`,this.handleBlur),this.host.addEventListener(`mousedown`,this.handleMouseDown),this.update(e)}renderMath(e){this.errorContainer.hidden=!0,this.errorContainer.textContent=``,this.previewContainer.textContent=``;try{zU.render(e,this.previewContainer,{displayMode:!1,throwOnError:!0})}catch{this.previewContainer.textContent=e,this.errorContainer.hidden=!1,this.errorContainer.textContent=this.messages.mathRenderError}}resolveCurrentNode(){if(this.currentPosition===null)return null;let e=this.view.state.doc.nodeAt(this.currentPosition);return $U(e)?e:null}openEditor(e){if(!QU(this.view)){this.closeEditor(!1);return}let t=this.view.state.doc.nodeAt(e);if(!$U(t)){this.closeEditor(!1);return}this.currentPosition=e,this.sourceInput.value=eW(t),this.renderMath(this.sourceInput.value);let n=this.resolveMathInlineElement(e);if(!n){this.closeEditor(!1);return}this.currentMathInlineElement=n,n.dataset.editing=`true`,n.append(this.host),this.host.style.display=`inline-flex`,requestAnimationFrame(()=>{if(this.currentPosition!==e)return;this.sourceInput.focus();let t=this.sourceInput.value.length;if(this.currentCaret===`start`){this.sourceInput.setSelectionRange(0,0);return}this.sourceInput.setSelectionRange(t,t)})}commitCurrentValue(e){if(this.currentPosition===null)return;let t=this.resolveCurrentNode();if(!t){this.closeEditor(!1);return}let n=this.sourceInput.value,r=typeof e==`number`?e:this.currentPosition+t.nodeSize,i=this.view.state.tr.setNodeMarkup(this.currentPosition,void 0,{...t.attrs,value:n});i.setSelection(this.createSafeTextSelection(i.doc,r)).setMeta(ZU,{type:`close`}).scrollIntoView(),this.isCommitting=!0,this.view.dispatch(i),this.isCommitting=!1,this.view.focus()}closeEditor(e){this.currentMathInlineElement&&(this.currentMathInlineElement.dataset.editing=`false`),this.currentPosition=null,this.currentMathInlineElement=null,this.host.style.display=`none`,this.host.remove(),e&&this.view.dispatch(this.view.state.tr.setMeta(ZU,{type:`close`}))}resolveMathInlineElement(e){let t=this.view.nodeDOM(e);return t instanceof HTMLElement?t:null}update(e){if(this.view=e,!QU(e)){this.closeEditor(!1);return}let t=ZU.getState(e.state);if(!t||t.position===null){this.currentPosition!==null&&this.closeEditor(!1);return}if(this.currentPosition!==t.position){this.currentCaret=t.caret,this.openEditor(t.position);return}if(!this.resolveCurrentNode()){this.closeEditor(!0);return}}destroy(){this.sourceInput.removeEventListener(`input`,this.handleInput),this.sourceInput.removeEventListener(`beforeinput`,this.handleBeforeInput),this.sourceInput.removeEventListener(`keydown`,this.handleKeyDown),this.sourceInput.removeEventListener(`blur`,this.handleBlur),this.host.removeEventListener(`mousedown`,this.handleMouseDown),this.currentMathInlineElement&&(this.currentMathInlineElement.dataset.editing=`false`),this.host.remove()}},rW=(e,t)=>zg(()=>new $c({key:ZU,state:{init:()=>({position:null,caret:`end`}),apply:(e,t)=>{let n=e.getMeta(ZU);if(n?.type===`open`&&typeof n.position==`number`)return{position:n.position,caret:n.caret===`start`?`start`:`end`};if(n?.type===`close`)return{position:null,caret:`end`};if(t.position===null||!e.docChanged)return t;let r=e.mapping.map(t.position,-1);return $U(e.doc.nodeAt(r))?{position:r,caret:t.caret}:{position:null,caret:`end`}}},view:t=>new nW(t,e)})),iW=`math_inline`,aW=e=>typeof e==`function`?e():null,oW=e=>typeof e.props.editable==`function`?e.props.editable(e.state):e.editable,sW=e=>String(e.attrs.value??e.textContent??``),cW=class{syncEditableState(){this.dom.dataset.editable=oW(this.view)?`true`:`false`}constructor(e,t,n,r){this.handleMouseDown=e=>{oW(this.view)||(e.preventDefault(),e.stopPropagation())},this.handleClick=e=>{if(e.preventDefault(),e.stopPropagation(),!oW(this.view))return;let t=aW(this.getPos);t!==null&&tW(this.view,t)},this.node=e,this.view=t,this.getPos=n,this.messages=r,this.dom=document.createElement(`span`),this.dom.dataset.type=iW,this.dom.className=`zt-md-math-inline`,this.dom.dataset.editing=`false`,this.syncEditableState(),this.previewContainer=document.createElement(`span`),this.previewContainer.className=`zt-md-math-inline-preview`,this.errorContainer=document.createElement(`span`),this.errorContainer.className=`zt-md-math-inline-error`,this.errorContainer.hidden=!0,this.dom.append(this.previewContainer,this.errorContainer),this.syncFromNode(e),this.dom.addEventListener(`mousedown`,this.handleMouseDown),this.dom.addEventListener(`click`,this.handleClick)}syncFromNode(e){let t=sW(e);this.dom.dataset.value=t,this.renderMath(t)}renderMath(e){this.errorContainer.hidden=!0,this.errorContainer.textContent=``,this.previewContainer.textContent=``;try{zU.render(e,this.previewContainer,{displayMode:!1,throwOnError:!0})}catch{this.previewContainer.textContent=e,this.errorContainer.hidden=!1,this.errorContainer.textContent=this.messages.mathRenderError}}update(e){return e.type.name===iW?(this.node=e,this.syncEditableState(),this.syncFromNode(e),!0):!1}stopEvent(e){let t=e.target;return t instanceof Element?e.type===`click`||!!t.closest(`.zt-md-math-inline-editor`):e.type===`click`}ignoreMutation(){return!0}destroy(){this.dom.removeEventListener(`mousedown`,this.handleMouseDown),this.dom.removeEventListener(`click`,this.handleClick)}},lW=(e=aO())=>(t,n,r)=>new cW(t,n,typeof r==`function`?()=>{let e=r();return typeof e==`number`?e:0}:!1,e),uW=`math_inline`,dW=`zt-md-math-inline-arrow-navigation`,fW={ArrowLeft:{positionKey:`from`},ArrowRight:{positionKey:`to`}},pW={ArrowLeft:`end`,ArrowRight:`start`},mW={Backspace:`before`,Delete:`after`},hW=e=>e instanceof Element?!!e.closest(`.zt-md-math-inline-editor`):!1,gW=e=>e?.type.name===uW,_W=e=>!mW[e.key]||e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||hW(e.target)||hW(document.activeElement),vW=(e,t)=>{if(!fW[t.key]||hW(t.target))return!1;let{selection:n}=e.state;return!(n instanceof N)||n.node.type.name!==uW?!1:(t.preventDefault(),tW(e,n.from,{caret:pW[t.key]??`end`}),!0)},yW=(e,t)=>{let n=fW[t.key];if(!n||hW(t.target))return!1;let{selection:r}=e.state;if(!r.empty)return!1;let i=r.$from,a=n.positionKey===`from`?i.nodeBefore:i.nodeAfter;return gW(a)?(t.preventDefault(),tW(e,n.positionKey===`from`?r.from-a.nodeSize:r.from,{caret:pW[t.key]??`end`}),!0):!1},bW=(e,t)=>{try{return M.create(e,t)}catch{return M.near(e.resolve(t),-1)}},xW=(e,t,n)=>{n.preventDefault();let r=t.from,i=e.state.tr.delete(t.from,t.to),a=i.doc.content.size,o=Math.min(r,a);return i.setSelection(bW(i.doc,o)).scrollIntoView(),e.dispatch(i),e.focus(),!0},SW=(e,t)=>{let n=mW[t.key];if(!n)return!1;let{selection:r}=e.state;if(!r.empty)return!1;let i=r.$from,a=n===`before`?i.nodeBefore:i.nodeAfter;if(!gW(a))return!1;t.preventDefault();let o=n===`before`?r.from-a.nodeSize:r.from;return e.dispatch(e.state.tr.setSelection(N.create(e.state.doc,o)).scrollIntoView()),e.focus(),!0},CW=(e,t)=>{if(_W(t))return!1;let{selection:n}=e.state;return n instanceof N&&gW(n.node)?xW(e,n,t):SW(e,t)},wW=(e,t)=>{if(hW(document.activeElement))return!1;let{selection:n}=e.state;if(!(n instanceof N)||n.node.type.name!==uW)return!1;let r=n.to,i=r+t.length,a=e.state.tr.insertText(t,r,r);return a.setSelection(M.create(a.doc,i)).scrollIntoView(),e.dispatch(a),e.focus(),!0},TW=zg(()=>new $c({key:new nl(dW),props:{handleKeyDown:(e,t)=>yW(e,t)||CW(e,t)?!0:vW(e,t),handleTextInput:(e,t,n,r)=>wW(e,r)}}));function EW(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:a},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:s,mathText:o,mathTextData:s}};function e(e){this.enter({type:`math`,meta:null,value:``,data:{hName:`pre`,hChildren:[{type:`element`,tagName:`code`,properties:{className:[`language-math`,`math-display`]},children:[]}]}},e)}function t(){this.buffer()}function n(){let e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.meta=e}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(e){let t=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t;let r=n.data.hChildren[0];r.type,r.tagName,r.children.push({type:`text`,value:t}),this.data.mathFlowInside=void 0}function a(e){this.enter({type:`inlineMath`,value:``,data:{hName:`code`,hProperties:{className:[`language-math`,`math-inline`]},hChildren:[]}},e),this.buffer()}function o(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t,n.data.hChildren.push({type:`text`,value:t})}function s(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}}function DW(e){let t=(e||{}).singleDollarTextMath;return t??=!0,r.peek=i,{unsafe:[{character:`\r`,inConstruct:`mathFlowMeta`},{character:`
|
|
356
|
+
`,inConstruct:`mathFlowMeta`},{character:`$`,after:t?void 0:`\\$`,inConstruct:`phrasing`},{character:`$`,inConstruct:`mathFlowMeta`},{atBreak:!0,character:`$`,after:`\\$`}],handlers:{math:n,inlineMath:r}};function n(e,t,n,r){let i=e.value||``,a=n.createTracker(r),o=`$`.repeat(Math.max(Br(i,`$`)+1,2)),s=n.enter(`mathFlow`),c=a.move(o);if(e.meta){let t=n.enter(`mathFlowMeta`);c+=a.move(n.safe(e.meta,{after:`
|
|
357
|
+
`,before:c,encode:[`$`],...a.current()})),t()}return c+=a.move(`
|
|
358
|
+
`),i&&(c+=a.move(i+`
|
|
359
|
+
`)),c+=a.move(o),s(),c}function r(e,n,r){let i=e.value||``,a=1;for(t||a++;RegExp(`(^|[^$])`+`\\$`.repeat(a)+`([^$]|$)`).test(i);)a++;let o=`$`.repeat(a);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` `+i+` `);let s=-1;for(;++s<r.unsafe.length;){let e=r.unsafe[s];if(!e.atBreak)continue;let t=r.compilePattern(e),n;for(;n=t.exec(i);){let e=n.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=i.slice(0,e)+` `+i.slice(n.index+1)}}return o+i+o}function i(){return`$`}}var OW={tokenize:AW,concrete:!0,name:`mathFlow`},kW={tokenize:jW,partial:!0};function AW(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){return e.enter(`mathFlow`),e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),c(t)}function c(t){return t===36?(e.consume(t),o++,c):o<2?n(t):(e.exit(`mathFlowFenceSequence`),Ze(e,l,`whitespace`)(t))}function l(t){return t===null||k(t)?d(t):(e.enter(`mathFlowFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===null||k(t)?(e.exit(`chunkString`),e.exit(`mathFlowFenceMeta`),d(t)):t===36?n(t):(e.consume(t),u)}function d(n){return e.exit(`mathFlowFence`),r.interrupt?t(n):e.attempt(kW,f,g)(n)}function f(t){return e.attempt({tokenize:_,partial:!0},g,p)(t)}function p(t){return(a?Ze(e,m,`linePrefix`,a+1):m)(t)}function m(t){return t===null?g(t):k(t)?e.attempt(kW,f,g)(t):(e.enter(`mathFlowValue`),h(t))}function h(t){return t===null||k(t)?(e.exit(`mathFlowValue`),m(t)):(e.consume(t),h)}function g(n){return e.exit(`mathFlow`),t(n)}function _(e,t,n){let i=0;return Ze(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),s(t)}function s(t){return t===36?(i++,e.consume(t),s):i<o?n(t):(e.exit(`mathFlowFenceSequence`),Ze(e,c,`whitespace`)(t))}function c(r){return r===null||k(r)?(e.exit(`mathFlowFence`),t(r)):n(r)}}}function jW(e,t,n){let r=this;return i;function i(n){return n===null?t(n):(e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function MW(e){let t=(e||{}).singleDollarTextMath;return t??=!0,{tokenize:n,resolve:NW,previous:PW,name:`mathText`};function n(e,n,r){let i=0,a,o;return s;function s(t){return e.enter(`mathText`),e.enter(`mathTextSequence`),c(t)}function c(n){return n===36?(e.consume(n),i++,c):i<2&&!t?r(n):(e.exit(`mathTextSequence`),l(n))}function l(t){return t===null?r(t):t===36?(o=e.enter(`mathTextSequence`),a=0,d(t)):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),l):k(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),l):(e.enter(`mathTextData`),u(t))}function u(t){return t===null||t===32||t===36||k(t)?(e.exit(`mathTextData`),l(t)):(e.consume(t),u)}function d(t){return t===36?(e.consume(t),a++,d):a===i?(e.exit(`mathTextSequence`),e.exit(`mathText`),n(t)):(o.type=`mathTextData`,u(t))}}}function NW(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`mathTextData`){e[t][1].type=`mathTextPadding`,e[n][1].type=`mathTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`mathTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function PW(e){return e!==36||this.events[this.events.length-1][1].type===`characterEscape`}function FW(e){return{flow:{36:OW},text:{36:MW(e)}}}var IW={};function LW(e){let t=this,n=e||IW,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(FW(n)),a.push(EW()),o.push(DW(n))}var RW=`math_inline`,zW=`math_block`,BW=/(?:\$)([^$]+)(?:\$)$/,VW=/^\$\$\s$/,HW=qg(`remarkMath`,()=>LW),UW=Vg({},`katexOptions`),WW=Hg(RW,e=>({group:`inline`,inline:!0,atom:!0,attrs:{value:{default:``}},parseDOM:[{tag:`span[data-type="${RW}"]`,getAttrs:e=>{let t=e;return{value:t.dataset.value??t.textContent??``}}}],toDOM:t=>{let n=String(t.attrs.value??t.textContent??``),r=document.createElement(`span`);return r.dataset.type=RW,r.dataset.value=n,zU.render(n,r,e.get(UW.key)),r},parseMarkdown:{match:e=>e.type===`inlineMath`,runner:(e,t,n)=>{let r=String(t.value??``);e.addNode(n,{value:r})}},toMarkdown:{match:e=>e.type.name===RW,runner:(e,t)=>{let n=String(t.attrs.value??t.textContent??``);e.addNode(`inlineMath`,void 0,n)}}})),GW=Hg(zW,e=>({content:`text*`,group:`block`,marks:``,defining:!0,atom:!0,isolating:!0,attrs:{value:{default:``}},parseDOM:[{tag:`div[data-type="${zW}"]`,preserveWhitespace:`full`,getAttrs:e=>({value:e.dataset.value??``})}],toDOM:t=>{let n=String(t.attrs.value??``),r=document.createElement(`div`);return r.dataset.type=zW,r.dataset.value=n,zU.render(n,r,e.get(UW.key)),r},parseMarkdown:{match:e=>e.type===`math`,runner:(e,t,n)=>{let r=String(t.value??``);e.addNode(n,{value:r})}},toMarkdown:{match:e=>e.type.name===zW,runner:(e,t)=>{let n=String(t.attrs.value??``);e.addNode(`math`,void 0,n)}}})),KW=Fg(e=>new zl(BW,(t,n,r,i)=>{let a=WW.type(e),o=n[1]??``,s=t.doc.resolve(r);return s.parent.canReplaceWith(s.index(),s.indexAfter(),a)?t.tr.replaceWith(r,i,a.create({value:o})):null})),qW=[HW,UW,WW,GW,Fg(e=>new zl(VW,(t,n,r,i)=>{let a=t.doc.resolve(r),o=GW.type(e);return a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),o)?t.tr.delete(r,i).setBlockType(r,r,o):null})),KW].flat(),JW=`blockquote`,YW=`paragraph`,XW=`Backspace`,ZW=e=>e.key!==XW||e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey,QW=e=>{if(e.parent.type.name!==YW||e.parentOffset!==0)return null;for(let t=e.depth;t>0;--t){let n=e.node(t);if(n.type.name!==JW)continue;let r=e.depth,i=e.index(t);return r<=t||i!==0?null:{paragraphDepth:r,blockquoteDepth:t,blockquoteType:n.type}}return null},$W=(e,t)=>{let{selection:n}=e.state;if(!n.empty)return!1;let r=n.$from,i=QW(r);if(!i)return!1;let a=r.blockRange(r,e=>e.type===i.blockquoteType);if(!a)return!1;let o=qs(a);if(o===null)return!1;t.preventDefault();let s=e.state.tr.lift(a,o).scrollIntoView();return e.dispatch(s),!0},eG=zg(()=>new $c({key:new nl(`zt-md-blockquote-backspace-lift`),props:{handleKeyDown:(e,t)=>ZW(t)?!1:$W(e,t)}})),tG=`code_block`,nG=1200,rG=e=>(0,f.renderToStaticMarkup)((0,d.createElement)(e,{size:14,strokeWidth:2,"aria-hidden":`true`})),iG=rG(TE),aG=rG(yE),oG=rG($E),sG=e=>typeof e==`function`?e():null,cG=e=>typeof e.props.editable==`function`?e.props.editable(e.state):e.editable,lG=class{syncLanguageAttribute(e){let t=typeof e.attrs.language==`string`?e.attrs.language.trim():``;if(!t){this.contentDOM.removeAttribute(`data-language`);return}this.contentDOM.setAttribute(`data-language`,t)}constructor(e,t,n,r){this.copyFeedbackTimer=null,this.handleCopyClick=e=>{if(e.preventDefault(),e.stopPropagation(),!cG(this.view))return;let t=this.node.textContent;(typeof navigator<`u`&&navigator.clipboard?.writeText?navigator.clipboard.writeText(t):Promise.resolve()).then(()=>{this.copyButton.innerHTML=aG,this.copyButton.dataset.copied=`true`,this.copyFeedbackTimer!==null&&clearTimeout(this.copyFeedbackTimer),this.copyFeedbackTimer=setTimeout(()=>{this.copyButton.innerHTML=iG,delete this.copyButton.dataset.copied,this.copyFeedbackTimer=null},nG)}).catch(()=>{})},this.handleDeleteClick=e=>{e.preventDefault(),e.stopPropagation(),cG(this.view)&&this.deleteCurrentCodeBlock()},this.node=e,this.view=t,this.getPos=n,this.dom=document.createElement(`div`),this.dom.className=`zt-md-code-block`,this.dom.dataset.type=tG,this.updateEditableState(),this.contentDOM=document.createElement(`pre`),this.actionsContainer=document.createElement(`span`),this.actionsContainer.className=`zt-md-code-block-actions`,this.copyButton=document.createElement(`button`),this.copyButton.type=`button`,this.copyButton.className=`zt-md-code-block-action-button`,this.copyButton.setAttribute(`aria-label`,r.codeBlockCopyAriaLabel),this.copyButton.innerHTML=iG,this.deleteButton=document.createElement(`button`),this.deleteButton.type=`button`,this.deleteButton.className=`zt-md-code-block-action-button zt-md-code-block-action-button-danger`,this.deleteButton.setAttribute(`aria-label`,r.codeBlockDeleteAriaLabel),this.deleteButton.innerHTML=oG,this.actionsContainer.append(this.copyButton,this.deleteButton),this.dom.append(this.contentDOM,this.actionsContainer),this.syncLanguageAttribute(e),this.copyButton.addEventListener(`click`,this.handleCopyClick),this.deleteButton.addEventListener(`click`,this.handleDeleteClick)}deleteCurrentCodeBlock(){let e=sG(this.getPos);if(e===null)return;let t=this.view.state.tr.delete(e,e+this.node.nodeSize),n=Math.min(e,t.doc.content.size);t.setSelection(M.near(t.doc.resolve(n),-1)).scrollIntoView(),this.view.dispatch(t),requestAnimationFrame(()=>{this.view.focus()})}updateEditableState(){this.dom.dataset.editable=cG(this.view)?`true`:`false`}update(e){return e.type.name===tG?(this.node=e,this.updateEditableState(),this.syncLanguageAttribute(e),!0):!1}stopEvent(e){let t=e.target;return t instanceof Node?this.actionsContainer.contains(t):!1}ignoreMutation(e){return e.type===`selection`?!1:this.actionsContainer.contains(e.target)}destroy(){this.copyButton.removeEventListener(`click`,this.handleCopyClick),this.deleteButton.removeEventListener(`click`,this.handleDeleteClick),this.copyFeedbackTimer!==null&&(clearTimeout(this.copyFeedbackTimer),this.copyFeedbackTimer=null),this.copyButton.innerHTML=iG,delete this.copyButton.dataset.copied}},uG=(e=aO())=>(t,n,r)=>new lG(t,n,typeof r==`function`?()=>{let e=r();return typeof e==`number`?e:0}:!1,e);dG.displayName=`clike`,dG.aliases=[];function dG(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}fG.displayName=`c`,fG.aliases=[];function fG(e){e.register(dG),e.languages.c=e.languages.extend(`clike`,{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),e.languages.insertBefore(`c`,`string`,{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),e.languages.insertBefore(`c`,`string`,{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:`property`,inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},e.languages.c.string],char:e.languages.c.char,comment:e.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:`function`}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:`keyword`},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:e.languages.c}}}}),e.languages.insertBefore(`c`,`function`,{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete e.languages.c.boolean}pG.displayName=`cpp`,pG.aliases=[];function pG(e){e.register(fG),(function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=`\\b(?!<keyword>)\\w+(?:\\s*\\.\\s*\\w+)*\\b`.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend(`c`,{"class-name":[{pattern:RegExp(`(\\b(?:class|concept|enum|struct|typename)\\s+)(?!<keyword>)\\w+`.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore(`cpp`,`string`,{module:{pattern:RegExp(`(\\b(?:import|module)\\s+)(?:"(?:\\\\(?:\\r\\n|[\\s\\S])|[^"\\\\\\r\\n])*"|<[^<>\\r\\n]*>|`+`<mod-name>(?:\\s*:\\s*<mod-name>)?|:\\s*<mod-name>`.replace(/<mod-name>/g,function(){return n})+`)`),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:`string`,greedy:!0}}),e.languages.insertBefore(`cpp`,`keyword`,{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:e.languages.cpp}}}}),e.languages.insertBefore(`cpp`,`operator`,{"double-colon":{pattern:/::/,alias:`punctuation`}}),e.languages.insertBefore(`cpp`,`class-name`,{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend(`cpp`,{})}}),e.languages.insertBefore(`inside`,`double-colon`,{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp[`base-clause`])})(e)}mG.displayName=`arduino`,mG.aliases=[`ino`];function mG(e){e.register(pG),e.languages.arduino=e.languages.extend(`cpp`,{keyword:/\b(?:String|array|bool|boolean|break|byte|case|catch|continue|default|do|double|else|finally|for|function|goto|if|in|instanceof|int|integer|long|loop|new|null|return|setup|string|switch|throw|try|void|while|word)\b/,constant:/\b(?:ANALOG_MESSAGE|DEFAULT|DIGITAL_MESSAGE|EXTERNAL|FIRMATA_STRING|HIGH|INPUT|INPUT_PULLUP|INTERNAL|INTERNAL1V1|INTERNAL2V56|LED_BUILTIN|LOW|OUTPUT|REPORT_ANALOG|REPORT_DIGITAL|SET_PIN_MODE|SYSEX_START|SYSTEM_RESET)\b/,builtin:/\b(?:Audio|BSSID|Bridge|Client|Console|EEPROM|Esplora|EsploraTFT|Ethernet|EthernetClient|EthernetServer|EthernetUDP|File|FileIO|FileSystem|Firmata|GPRS|GSM|GSMBand|GSMClient|GSMModem|GSMPIN|GSMScanner|GSMServer|GSMVoiceCall|GSM_SMS|HttpClient|IPAddress|IRread|Keyboard|KeyboardController|LiquidCrystal|LiquidCrystal_I2C|Mailbox|Mouse|MouseController|PImage|Process|RSSI|RobotControl|RobotMotor|SD|SPI|SSID|Scheduler|Serial|Server|Servo|SoftwareSerial|Stepper|Stream|TFT|Task|USBHost|WiFi|WiFiClient|WiFiServer|WiFiUDP|Wire|YunClient|YunServer|abs|addParameter|analogRead|analogReadResolution|analogReference|analogWrite|analogWriteResolution|answerCall|attach|attachGPRS|attachInterrupt|attached|autoscroll|available|background|beep|begin|beginPacket|beginSD|beginSMS|beginSpeaker|beginTFT|beginTransmission|beginWrite|bit|bitClear|bitRead|bitSet|bitWrite|blink|blinkVersion|buffer|changePIN|checkPIN|checkPUK|checkReg|circle|cityNameRead|cityNameWrite|clear|clearScreen|click|close|compassRead|config|connect|connected|constrain|cos|countryNameRead|countryNameWrite|createChar|cursor|debugPrint|delay|delayMicroseconds|detach|detachInterrupt|digitalRead|digitalWrite|disconnect|display|displayLogos|drawBMP|drawCompass|encryptionType|end|endPacket|endSMS|endTransmission|endWrite|exists|exitValue|fill|find|findUntil|flush|gatewayIP|get|getAsynchronously|getBand|getButton|getCurrentCarrier|getIMEI|getKey|getModifiers|getOemKey|getPINUsed|getResult|getSignalStrength|getSocket|getVoiceCallStatus|getXChange|getYChange|hangCall|height|highByte|home|image|interrupts|isActionDone|isDirectory|isListening|isPIN|isPressed|isValid|keyPressed|keyReleased|keyboardRead|knobRead|leftToRight|line|lineFollowConfig|listen|listenOnLocalhost|loadImage|localIP|lowByte|macAddress|maintain|map|max|messageAvailable|micros|millis|min|mkdir|motorsStop|motorsWrite|mouseDragged|mouseMoved|mousePressed|mouseReleased|move|noAutoscroll|noBlink|noBuffer|noCursor|noDisplay|noFill|noInterrupts|noListenOnLocalhost|noStroke|noTone|onReceive|onRequest|open|openNextFile|overflow|parseCommand|parseFloat|parseInt|parsePacket|pauseMode|peek|pinMode|playFile|playMelody|point|pointTo|position|pow|prepare|press|print|printFirmwareVersion|printVersion|println|process|processInput|pulseIn|put|random|randomSeed|read|readAccelerometer|readBlue|readButton|readBytes|readBytesUntil|readGreen|readJoystickButton|readJoystickSwitch|readJoystickX|readJoystickY|readLightSensor|readMessage|readMicrophone|readNetworks|readRed|readSlider|readString|readStringUntil|readTemperature|ready|rect|release|releaseAll|remoteIP|remoteNumber|remotePort|remove|requestFrom|retrieveCallingNumber|rewindDirectory|rightToLeft|rmdir|robotNameRead|robotNameWrite|run|runAsynchronously|runShellCommand|runShellCommandAsynchronously|running|scanNetworks|scrollDisplayLeft|scrollDisplayRight|seek|sendAnalog|sendDigitalPortPair|sendDigitalPorts|sendString|sendSysex|serialEvent|setBand|setBitOrder|setClockDivider|setCursor|setDNS|setDataMode|setFirmwareVersion|setMode|setPINUsed|setSpeed|setTextSize|setTimeout|shiftIn|shiftOut|shutdown|sin|size|sqrt|startLoop|step|stop|stroke|subnetMask|switchPIN|tan|tempoWrite|text|tone|transfer|tuneWrite|turn|updateIR|userNameRead|userNameWrite|voiceCall|waitContinue|width|write|writeBlue|writeGreen|writeJSON|writeMessage|writeMicroseconds|writeRGB|writeRed|yield)\b/}),e.languages.ino=e.languages.arduino}hG.displayName=`bash`,hG.aliases=[`sh`,`shell`];function hG(e){(function(e){var t=`\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b`,n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:`punctuation`,inside:null},r={bash:n,environment:{pattern:RegExp(`\\$`+t),alias:`constant`},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp(`(\\{)`+t),lookbehind:!0,alias:`constant`}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:`important`},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:`function`},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:`function`}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:`variable`,lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp(`(^|[\\s;|&]|[<>]\\()`+t),lookbehind:!0,alias:`constant`}},alias:`variable`,lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:`variable`,lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp(`\\$?`+t),alias:`constant`},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:`class-name`},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:`important`},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:`important`}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var i=[`comment`,`function-name`,`for-or-select`,`assign-left`,`parameter`,`string`,`environment`,`function`,`keyword`,`builtin`,`boolean`,`file-descriptor`,`operator`,`punctuation`,`number`],a=r.variable[1].inside,o=0;o<i.length;o++)a[i[o]]=e.languages.bash[i[o]];e.languages.sh=e.languages.bash,e.languages.shell=e.languages.bash})(e)}gG.displayName=`csharp`,gG.aliases=[`cs`,`dotnet`];function gG(e){e.register(dG),(function(e){function t(e,t){return e.replace(/<<(\d+)>>/g,function(e,n){return`(?:`+t[+n]+`)`})}function n(e,n,r){return RegExp(t(e,n),r||``)}function r(e,t){for(var n=0;n<t;n++)e=e.replace(/<<self>>/g,function(){return`(?:`+e+`)`});return e.replace(/<<self>>/g,`[^\\s\\S]`)}var i={type:`bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void`,typeDeclaration:`class enum interface record struct`,contextual:`add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)`,other:`abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield`};function a(e){return`\\b(?:`+e.trim().replace(/ /g,`|`)+`)\\b`}var o=a(i.typeDeclaration),s=RegExp(a(i.type+` `+i.typeDeclaration+` `+i.contextual+` `+i.other)),c=a(i.typeDeclaration+` `+i.contextual+` `+i.other),l=a(i.type+` `+i.typeDeclaration+` `+i.other),u=r(`<(?:[^<>;=+\\-*/%&|^]|<<self>>)*>`,2),d=r(`\\((?:[^()]|<<self>>)*\\)`,2),f=`@?\\b[A-Za-z_]\\w*\\b`,p=t(`<<0>>(?:\\s*<<1>>)?`,[f,u]),m=t(`(?!<<0>>)<<1>>(?:\\s*\\.\\s*<<1>>)*`,[c,p]),h=`\\[\\s*(?:,\\s*)*\\]`,g=t(`<<0>>(?:\\s*(?:\\?\\s*)?<<1>>)*(?:\\s*\\?)?`,[m,h]),_=t(`(?:<<0>>|<<1>>)(?:\\s*(?:\\?\\s*)?<<2>>)*(?:\\s*\\?)?`,[t(`\\(<<0>>+(?:,<<0>>+)+\\)`,[t(`[^,()<>[\\];=+\\-*/%&|^]|<<0>>|<<1>>|<<2>>`,[u,d,h])]),m,h]),v={keyword:s,punctuation:/[<>()?,.:[\]]/},y=`'(?:[^\\r\\n'\\\\]|\\\\.|\\\\[Uux][\\da-fA-F]{1,8})'`,b=`"(?:\\\\.|[^\\\\"\\r\\n])*"`,x=`@"(?:""|\\\\[\\s\\S]|[^\\\\"])*"(?!")`;e.languages.csharp=e.languages.extend(`clike`,{string:[{pattern:n(`(^|[^$\\\\])<<0>>`,[x]),lookbehind:!0,greedy:!0},{pattern:n(`(^|[^@$\\\\])<<0>>`,[b]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:n(`(\\busing\\s+static\\s+)<<0>>(?=\\s*;)`,[m]),lookbehind:!0,inside:v},{pattern:n(`(\\busing\\s+<<0>>\\s*=\\s*)<<1>>(?=\\s*;)`,[f,_]),lookbehind:!0,inside:v},{pattern:n(`(\\busing\\s+)<<0>>(?=\\s*=)`,[f]),lookbehind:!0},{pattern:n(`(\\b<<0>>\\s+)<<1>>`,[o,p]),lookbehind:!0,inside:v},{pattern:n(`(\\bcatch\\s*\\(\\s*)<<0>>`,[m]),lookbehind:!0,inside:v},{pattern:n(`(\\bwhere\\s+)<<0>>`,[f]),lookbehind:!0},{pattern:n(`(\\b(?:is(?:\\s+not)?|as)\\s+)<<0>>`,[g]),lookbehind:!0,inside:v},{pattern:n(`\\b<<0>>(?=\\s+(?!<<1>>|with\\s*\\{)<<2>>(?:\\s*[=,;:{)\\]]|\\s+(?:in|when)\\b))`,[_,l,f]),inside:v}],keyword:s,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),e.languages.insertBefore(`csharp`,`number`,{range:{pattern:/\.\./,alias:`operator`}}),e.languages.insertBefore(`csharp`,`punctuation`,{"named-parameter":{pattern:n(`([(,]\\s*)<<0>>(?=\\s*:)`,[f]),lookbehind:!0,alias:`punctuation`}}),e.languages.insertBefore(`csharp`,`class-name`,{namespace:{pattern:n(`(\\b(?:namespace|using)\\s+)<<0>>(?:\\s*\\.\\s*<<0>>)*(?=\\s*[;{])`,[f]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:n(`(\\b(?:default|sizeof|typeof)\\s*\\(\\s*(?!\\s))(?:[^()\\s]|\\s(?!\\s)|<<0>>)*(?=\\s*\\))`,[d]),lookbehind:!0,alias:`class-name`,inside:v},"return-type":{pattern:n(`<<0>>(?=\\s+(?:<<1>>\\s*(?:=>|[({]|\\.\\s*this\\s*\\[)|this\\s*\\[))`,[_,m]),inside:v,alias:`class-name`},"constructor-invocation":{pattern:n(`(\\bnew\\s+)<<0>>(?=\\s*[[({])`,[_]),lookbehind:!0,inside:v,alias:`class-name`},"generic-method":{pattern:n(`<<0>>\\s*<<1>>(?=\\s*\\()`,[f,u]),inside:{function:n(`^<<0>>`,[f]),generic:{pattern:RegExp(u),alias:`class-name`,inside:v}}},"type-list":{pattern:n(`\\b((?:<<0>>\\s+<<1>>|record\\s+<<1>>\\s*<<5>>|where\\s+<<2>>)\\s*:\\s*)(?:<<3>>|<<4>>|<<1>>\\s*<<5>>|<<6>>)(?:\\s*,\\s*(?:<<3>>|<<4>>|<<6>>))*(?=\\s*(?:where|[{;]|=>|$))`,[o,p,f,_,s.source,d,`\\bnew\\s*\\(\\s*\\)`]),lookbehind:!0,inside:{"record-arguments":{pattern:n(`(^(?!new\\s*\\()<<0>>\\s*)<<1>>`,[p,d]),lookbehind:!0,greedy:!0,inside:e.languages.csharp},keyword:s,"class-name":{pattern:RegExp(_),greedy:!0,inside:v},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:`property`,inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:`keyword`}}}});var S=b+`|`+y,C=t(`\\/(?![*/])|\\/\\/[^\\r\\n]*[\\r\\n]|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/|<<0>>`,[S]),w=r(t(`[^"'/()]|<<0>>|\\(<<self>>*\\)`,[C]),2),T=`\\b(?:assembly|event|field|method|module|param|property|return|type)\\b`,E=t(`<<0>>(?:\\s*\\(<<1>>*\\))?`,[m,w]);e.languages.insertBefore(`csharp`,`class-name`,{attribute:{pattern:n(`((?:^|[^\\s\\w>)?])\\s*\\[\\s*)(?:<<0>>\\s*:\\s*)?<<1>>(?:\\s*,\\s*<<1>>)*(?=\\s*\\])`,[T,E]),lookbehind:!0,greedy:!0,inside:{target:{pattern:n(`^<<0>>(?=\\s*:)`,[T]),alias:`keyword`},"attribute-arguments":{pattern:n(`\\(<<0>>*\\)`,[w]),inside:e.languages.csharp},"class-name":{pattern:RegExp(m),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var D=`:[^}\\r\\n]+`,ee=r(t(`[^"'/()]|<<0>>|\\(<<self>>*\\)`,[C]),2),te=t(`\\{(?!\\{)(?:(?![}:])<<0>>)*<<1>>?\\}`,[ee,D]),ne=r(t(`[^"'/()]|\\/(?!\\*)|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/|<<0>>|\\(<<self>>*\\)`,[S]),2),re=t(`\\{(?!\\{)(?:(?![}:])<<0>>)*<<1>>?\\}`,[ne,D]);function ie(t,r){return{interpolation:{pattern:n(`((?:^|[^{])(?:\\{\\{)*)<<0>>`,[t]),lookbehind:!0,inside:{"format-string":{pattern:n(`(^\\{(?:(?![}:])<<0>>)*)<<1>>(?=\\}$)`,[r,D]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:`language-csharp`,inside:e.languages.csharp}}},string:/[\s\S]+/}}e.languages.insertBefore(`csharp`,`string`,{"interpolation-string":[{pattern:n(`(^|[^\\\\])(?:\\$@|@\\$)"(?:""|\\\\[\\s\\S]|\\{\\{|<<0>>|[^\\\\{"])*"`,[te]),lookbehind:!0,greedy:!0,inside:ie(te,ee)},{pattern:n(`(^|[^@\\\\])\\$"(?:\\\\.|\\{\\{|<<0>>|[^\\\\"{])*"`,[re]),lookbehind:!0,greedy:!0,inside:ie(re,ne)}],char:{pattern:RegExp(y),greedy:!0}}),e.languages.dotnet=e.languages.cs=e.languages.csharp})(e)}_G.displayName=`markup`,_G.aliases=[`atom`,`html`,`mathml`,`rss`,`ssml`,`svg`,`xml`];function _G(e){e.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:`attr-equals`},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:`named-entity`},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside[`attr-value`].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside[`internal-subset`].inside=e.languages.markup,e.hooks.add(`wrap`,function(e){e.type===`entity`&&(e.attributes.title=e.content.value.replace(/&/,`&`))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(t,n){var r={};r[`language-`+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:e.languages[n]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};i[`language-`+n]={pattern:/[\s\S]+/,inside:e.languages[n]};var a={};a[t]={pattern:RegExp(`(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)`.replace(/__/g,function(){return t}),`i`),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore(`markup`,`cdata`,a)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(t,n){e.languages.markup.tag.inside[`special-attr`].push({pattern:RegExp(`(^|["'\\s])(?:`+t+`)\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s'">=]+(?=[\\s>]))`,`i`),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,`language-`+n],inside:e.languages[n]},punctuation:[{pattern:/^=/,alias:`attr-equals`},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend(`markup`,{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}vG.displayName=`css`,vG.aliases=[];function vG(e){(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp(`@[\\w-](?:[^;{\\s"']|\\s+(?!\\s)|`+t.source+`)*?(?:;|(?=\\s*\\{))`),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:`selector`},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp(`\\burl\\((?:`+t.source+`|(?:[^\\\\\\r\\n()"']|\\\\[\\s\\S])*)\\)`,`i`),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp(`^`+t.source+`$`),alias:`url`}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+`)*(?=\\s*\\{)`),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined(`style`,`css`),n.tag.addAttribute(`style`,`css`))})(e)}yG.displayName=`diff`,yG.aliases=[];function yG(e){(function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":`-`,"deleted-arrow":`<`,"inserted-sign":`+`,"inserted-arrow":`>`,unchanged:` `,diff:`!`};Object.keys(t).forEach(function(n){var r=t[n],i=[];/^\w+$/.test(n)||i.push(/\w+/.exec(n)[0]),n===`diff`&&i.push(`bold`),e.languages.diff[n]={pattern:RegExp(`^(?:[`+r+`].*(?:\r
|
|
308
360
|
?|
|
|
309
|
-
|(?![\\s\\S])))+`,`m`),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}}),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})})(e)}C_.displayName=`go`,C_.aliases=[];function C_(e){e.register(m_),e.languages.go=e.languages.extend(`clike`,{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),e.languages.insertBefore(`go`,`string`,{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete e.languages.go[`class-name`]}w_.displayName=`ini`,w_.aliases=[];function w_(e){e.languages.ini={comment:{pattern:/(^[ \f\t\v]*)[#;][^\n\r]*/m,lookbehind:!0},section:{pattern:/(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m,lookbehind:!0,inside:{"section-name":{pattern:/(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/,lookbehind:!0,alias:`selector`},punctuation:/\[|\]/}},key:{pattern:/(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m,lookbehind:!0,alias:`attr-name`},value:{pattern:/(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/,lookbehind:!0,alias:`attr-value`,inside:{"inner-value":{pattern:/^("|').+(?=\1$)/,lookbehind:!0}}},punctuation:/=/}}T_.displayName=`java`,T_.aliases=[];function T_(e){e.register(m_),(function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=`(?:[a-z]\\w*\\s*\\.\\s*)*(?:[A-Z]\\w*\\s*\\.\\s*)*`,r={pattern:RegExp(`(^|[^\\w.])`+n+`[A-Z](?:[\\d_A-Z]*[a-z]\\w*)?\\b`),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend(`clike`,{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(`(^|[^\\w.])`+n+`[A-Z]\\w*(?=\\s+\\w+\\s*[;,=()]|\\s*(?:\\[[\\s,]*\\]\\s*)?::\\s*new\\b)`),lookbehind:!0,inside:r.inside},{pattern:RegExp(`(\\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\\s+)`+n+`[A-Z]\\w*\\b`),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore(`java`,`string`,{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:`string`},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore(`java`,`class-name`,{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:`punctuation`},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(`(\\bimport\\s+)`+n+`(?:[A-Z]\\w*|\\*)(?=\\s*;)`),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(`(\\bimport\\s+static\\s+)`+n+`(?:\\w+|\\*)(?=\\s*;)`),lookbehind:!0,alias:`static`,inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(`(\\b(?:exports|import(?:\\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\\s+)(?!<keyword>)[a-z]\\w*(?:\\.[a-z]\\w*)*\\.?`.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}E_.displayName=`regex`,E_.aliases=[];function E_(e){(function(e){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:`escape`},n=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,r={pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:`class-name`},i={pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:`class-name`},a=`(?:[^\\\\-]|`+n.source+`)`,o=RegExp(a+`-`+a),s={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:`variable`};e.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:`operator`},"char-class-punctuation":{pattern:/^\[|\]$/,alias:`punctuation`},range:{pattern:o,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:`operator`}}},"special-escape":t,"char-set":i,escape:n}},"special-escape":t,"char-set":r,backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:`keyword`},{pattern:/\\k<[^<>']+>/,alias:`keyword`,inside:{"group-name":s}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:`function`},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:`punctuation`,inside:{"group-name":s}},{pattern:/\)/,alias:`punctuation`}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:`number`},alternation:{pattern:/\|/,alias:`keyword`}}})(e)}D_.displayName=`javascript`,D_.aliases=[`js`];function D_(e){e.register(m_),e.languages.javascript=e.languages.extend(`clike`,{"class-name":[e.languages.clike[`class-name`],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(`(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])`),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript[`class-name`][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore(`javascript`,`keyword`,{regex:{pattern:RegExp(`((?:^|[^$\\w\\xA0-\\uFFFF."'\\])\\s]|\\b(?:return|yield))\\s*)\\/(?:(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))`),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:`language-regex`,inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:`function`},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore(`javascript`,`string`,{hashbang:{pattern:/^#!.*/,greedy:!0,alias:`comment`},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:`string`},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:`punctuation`},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:`property`}}),e.languages.insertBefore(`javascript`,`operator`,{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:`property`}}),e.languages.markup&&(e.languages.markup.tag.addInlined(`script`,`javascript`),e.languages.markup.tag.addAttribute(`on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)`,`javascript`)),e.languages.js=e.languages.javascript}O_.displayName=`json`,O_.aliases=[`webmanifest`];function O_(e){e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:`keyword`}},e.languages.webmanifest=e.languages.json}k_.displayName=`kotlin`,k_.aliases=[`kt`,`kts`];function k_(e){e.register(m_),(function(e){e.languages.kotlin=e.languages.extend(`clike`,{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete e.languages.kotlin[`class-name`];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:`punctuation`},expression:{pattern:/[\s\S]+/,inside:e.languages.kotlin}};e.languages.insertBefore(`kotlin`,`string`,{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:`multiline`,inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:`singleline`,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete e.languages.kotlin.string,e.languages.insertBefore(`kotlin`,`keyword`,{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:`builtin`}}),e.languages.insertBefore(`kotlin`,`function`,{label:{pattern:/\b\w+@|@\w+\b/,alias:`symbol`}}),e.languages.kt=e.languages.kotlin,e.languages.kts=e.languages.kotlin})(e)}A_.displayName=`less`,A_.aliases=[];function A_(e){e.register(x_),e.languages.less=e.languages.extend(`css`,{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),e.languages.insertBefore(`less`,`property`,{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:`function`}})}j_.displayName=`lua`,j_.aliases=[];function j_(e){e.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/}}M_.displayName=`makefile`,M_.aliases=[];function M_(e){e.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:`builtin`},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:`symbol`,inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/}}N_.displayName=`yaml`,N_.aliases=[`yml`];function N_(e){(function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r=`(?:`+n.source+`(?:[ ]+`+t.source+`)?|`+t.source+`(?:[ ]+`+n.source+`)?)`,i=`(?:[^\\s\\x00-\\x08\\x0e-\\x1f!"#%&'*,\\-:>?@[\\]\`{|}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]|[?:-]<PLAIN>)(?:[ \\t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*`.replace(/<PLAIN>/g,function(){return`[^\\s\\x00-\\x08\\x0e-\\x1f,[\\]{}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]`}),a=`"(?:[^"\\\\\\r\\n]|\\\\.)*"|'(?:[^'\\\\\\r\\n]|\\\\.)*'`;function o(e,t){t=(t||``).replace(/m/g,``)+`m`;var n=`([:\\-,[{]\\s*(?:\\s<<prop>>[ \\t]+)?)(?:<<value>>)(?=[ \\t]*(?:$|,|\\]|\\}|(?:[\\r\\n]\\s*)?#))`.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return e});return RegExp(n,t)}e.languages.yaml={scalar:{pattern:RegExp(`([\\-:]\\s*(?:\\s<<prop>>[ \\t]+)?[|>])[ \\t]*(?:((?:\\r?\\n|\\r)[ \\t]+)\\S[^\\r\\n]*(?:\\2[^\\r\\n]+)*)`.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:`string`},comment:/#.*/,key:{pattern:RegExp(`((?:^|[:\\-,[{\\r\\n?])[ \\t]*(?:<<prop>>[ \\t]+)?)<<key>>(?=\\s*:\\s)`.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return`(?:`+i+`|`+a+`)`})),lookbehind:!0,greedy:!0,alias:`atrule`},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:`important`},datetime:{pattern:o(`\\d{4}-\\d\\d?-\\d\\d?(?:[tT]|[ \\t]+)\\d\\d?:\\d{2}:\\d{2}(?:\\.\\d*)?(?:[ \\t]*(?:Z|[-+]\\d\\d?(?::\\d{2})?))?|\\d{4}-\\d{2}-\\d{2}|\\d\\d?:\\d{2}(?::\\d{2}(?:\\.\\d*)?)?`),lookbehind:!0,alias:`number`},boolean:{pattern:o(`false|true`,`i`),lookbehind:!0,alias:`important`},null:{pattern:o(`null|~`,`i`),lookbehind:!0,alias:`important`},string:{pattern:o(a),lookbehind:!0,greedy:!0},number:{pattern:o(`[+-]?(?:0x[\\da-f]+|0o[0-7]+|(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?|\\.inf|\\.nan)`,`i`),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml})(e)}P_.displayName=`markdown`,P_.aliases=[`md`];function P_(e){e.register(b_),(function(e){var t=`(?:\\\\.|[^\\\\\\n\\r]|(?:\\n|\\r\\n?)(?![\\r\\n]))`;function n(e){return e=e.replace(/<inner>/g,function(){return t}),RegExp(`((?:^|[^\\\\])(?:\\\\{2})*)(?:`+e+`)`)}var r="(?:\\\\.|``(?:[^`\\r\\n]|`(?!`))+``|`[^`\\r\\n]+`|[^\\\\|\\r\\n`])+",i=`\\|?__(?:\\|__)+\\|?(?:(?:\\n|\\r\\n?)|(?![\\s\\S]))`.replace(/__/g,function(){return r}),a=`\\|?[ \\t]*:?-{3,}:?[ \\t]*(?:\\|[ \\t]*:?-{3,}:?[ \\t]*)+\\|?(?:\\n|\\r\\n?)`;e.languages.markdown=e.languages.extend(`markup`,{}),e.languages.insertBefore(`markdown`,`prolog`,{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:[`yaml`,`language-yaml`],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:`punctuation`},table:{pattern:RegExp(`^`+i+a+`(?:`+i+`)*`,`m`),inside:{"table-data-rows":{pattern:RegExp(`^(`+i+a+`)(?:`+i+`)*$`),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp(`^(`+i+`)`+a+`$`),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp(`^`+i+`$`),inside:{"table-header":{pattern:RegExp(r),alias:`important`,inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:`keyword`},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:`important`,inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:`important`,inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:`punctuation`},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:`punctuation`},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:`url`},bold:{pattern:n(`\\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\\b|\\*\\*(?:(?!\\*)<inner>|\\*(?:(?!\\*)<inner>)+\\*)+\\*\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(`\\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\\b|\\*(?:(?!\\*)<inner>|\\*\\*(?:(?!\\*)<inner>)+\\*\\*)+\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(`(~~?)(?:(?!~)<inner>)+\\2`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:[`code`,`keyword`]},url:{pattern:n(`!?\\[(?:(?!\\])<inner>)+\\](?:\\([^\\s)]+(?:[\\t ]+"(?:\\\\.|[^"\\\\])*")?\\)|[ \\t]?\\[(?:(?!\\])<inner>)+\\])`),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),[`url`,`bold`,`italic`,`strike`].forEach(function(t){[`url`,`bold`,`italic`,`strike`,`code-snippet`].forEach(function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])})}),e.hooks.add(`after-tokenize`,function(e){if(e.language!==`markdown`&&e.language!==`md`)return;function t(e){if(!(!e||typeof e==`string`))for(var n=0,r=e.length;n<r;n++){var i=e[n];if(i.type!==`code`){t(i.content);continue}var a=i.content[1],o=i.content[3];if(a&&o&&a.type===`code-language`&&o.type===`code-block`&&typeof a.content==`string`){var s=a.content.replace(/\b#/g,`sharp`).replace(/\b\+\+/g,`pp`);s=(/[a-z][\w-]*/i.exec(s)||[``])[0].toLowerCase();var c=`language-`+s;o.alias?typeof o.alias==`string`?o.alias=[o.alias,c]:o.alias.push(c):o.alias=[c]}}}t(e.tokens)}),e.hooks.add(`wrap`,function(t){if(t.type===`code-block`){for(var n=``,r=0,i=t.classes.length;r<i;r++){var a=t.classes[r],o=/language-(.+)/.exec(a);if(o){n=o[1];break}}var s=e.languages[n];if(s)t.content=e.highlight(t.content.value,s,n);else if(n&&n!==`none`&&e.plugins.autoloader){var c=`md-`+new Date().valueOf()+`-`+Math.floor(Math.random()*0x2386f26fc10000);t.attributes.id=c,e.plugins.autoloader.loadLanguages(n,function(){var t=document.getElementById(c);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))})}}}),RegExp(e.languages.markup.tag.pattern.source,`gi`),String.fromCodePoint||String.fromCharCode,e.languages.md=e.languages.markdown})(e)}F_.displayName=`objectivec`,F_.aliases=[`objc`];function F_(e){e.register(h_),e.languages.objectivec=e.languages.extend(`c`,{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec[`class-name`],e.languages.objc=e.languages.objectivec}I_.displayName=`perl`,I_.aliases=[];function I_(e){(function(e){var t=`(?:\\((?:[^()\\\\]|\\\\[\\s\\S])*\\)|\\{(?:[^{}\\\\]|\\\\[\\s\\S])*\\}|\\[(?:[^[\\]\\\\]|\\\\[\\s\\S])*\\]|<(?:[^<>\\\\]|\\\\[\\s\\S])*>)`;e.languages.perl={comment:[{pattern:/(^\s*)=\w[\s\S]*?=cut.*/m,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0,greedy:!0}],string:[{pattern:RegExp(`\\b(?:q|qq|qw|qx)(?![a-zA-Z0-9])\\s*(?:`+[`([^a-zA-Z0-9\\s{(\\[<])(?:(?!\\1)[^\\\\]|\\\\[\\s\\S])*\\1`,`([a-zA-Z0-9])(?:(?!\\2)[^\\\\]|\\\\[\\s\\S])*\\2`,t].join(`|`)+`)`),greedy:!0},{pattern:/("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/'(?:[^'\\\r\n]|\\.)*'/,greedy:!0}],regex:[{pattern:RegExp(`\\b(?:m|qr)(?![a-zA-Z0-9])\\s*(?:`+[`([^a-zA-Z0-9\\s{(\\[<])(?:(?!\\1)[^\\\\]|\\\\[\\s\\S])*\\1`,`([a-zA-Z0-9])(?:(?!\\2)[^\\\\]|\\\\[\\s\\S])*\\2`,t].join(`|`)+`)[msixpodualngc]*`),greedy:!0},{pattern:RegExp(`(^|[^-])\\b(?:s|tr|y)(?![a-zA-Z0-9])\\s*(?:`+[`([^a-zA-Z0-9\\s{(\\[<])(?:(?!\\2)[^\\\\]|\\\\[\\s\\S])*\\2(?:(?!\\2)[^\\\\]|\\\\[\\s\\S])*\\2`,`([a-zA-Z0-9])(?:(?!\\3)[^\\\\]|\\\\[\\s\\S])*\\3(?:(?!\\3)[^\\\\]|\\\\[\\s\\S])*\\3`,t+`\\s*`+t].join(`|`)+`)[msixpodualngcer]*`),lookbehind:!0,greedy:!0},{pattern:/\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|x|xor)\b))/,greedy:!0}],variable:[/[&*$@%]\{\^[A-Z]+\}/,/[&*$@%]\^[A-Z_]/,/[&*$@%]#?(?=\{)/,/[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/,/[&*$@%]\d+/,/(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],filehandle:{pattern:/<(?![<=])\S*?>|\b_\b/,alias:`symbol`},"v-string":{pattern:/v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,alias:`string`},function:{pattern:/(\bsub[ \t]+)\w+/,lookbehind:!0},keyword:/\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/,punctuation:/[{}[\];(),:]/}})(e)}L_.displayName=`markup-templating`,L_.aliases=[];function L_(e){e.register(b_),(function(e){function t(e,t){return`___`+e.toUpperCase()+t+`___`}Object.defineProperties(e.languages[`markup-templating`]={},{buildPlaceholders:{value:function(n,r,i,a){if(n.language===r){var o=n.tokenStack=[];n.code=n.code.replace(i,function(e){if(typeof a==`function`&&!a(e))return e;for(var i=o.length,s;n.code.indexOf(s=t(r,i))!==-1;)++i;return o[i]=e,s}),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,r){if(n.language!==r||!n.tokenStack)return;n.grammar=e.languages[r];var i=0,a=Object.keys(n.tokenStack);function o(s){for(var c=0;c<s.length&&!(i>=a.length);c++){var l=s[c];if(typeof l==`string`||l.content&&typeof l.content==`string`){var u=a[i],d=n.tokenStack[u],f=typeof l==`string`?l:l.content,p=t(r,u),m=f.indexOf(p);if(m>-1){++i;var h=f.substring(0,m),g=new e.Token(r,e.tokenize(d,n.grammar),`language-`+r,d),_=f.substring(m+p.length),v=[];h&&v.push.apply(v,o([h])),v.push(g),_&&v.push.apply(v,o([_])),typeof l==`string`?s.splice.apply(s,[c,1].concat(v)):l.content=v}}else l.content&&o(l.content)}return s}o(n.tokens)}}})})(e)}R_.displayName=`php`,R_.aliases=[];function R_(e){e.register(L_),(function(e){var t=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,n=[{pattern:/\b(?:false|true)\b/i,alias:`boolean`},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],r=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,i=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,a=/[{}\[\](),:;]/;e.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:`important`},comment:t,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:`class-name`},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:`function`},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:`type-casting`,greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:`type-hint`,greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:`return-type`,greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:`type-declaration`,greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:`type-declaration`,greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:`static-context`,greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:`class-name-fully-qualified`,greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:`class-name-fully-qualified`,greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:`class-name-fully-qualified`,greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:`type-declaration`,greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:[`class-name-fully-qualified`,`type-declaration`],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:`static-context`,greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:[`class-name-fully-qualified`,`static-context`],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:`type-hint`,greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:[`class-name-fully-qualified`,`type-hint`],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:`return-type`,greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:[`class-name-fully-qualified`,`return-type`],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:r,operator:i,punctuation:a};var o={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:e.languages.php},s=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:`nowdoc-string`,greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:`symbol`,inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:`heredoc-string`,greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:`symbol`,inside:{punctuation:/^<<<"?|[";]$/}},interpolation:o}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:`backtick-quoted-string`,greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:`single-quoted-string`,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:`double-quoted-string`,greedy:!0,inside:{interpolation:o}}];e.languages.insertBefore(`php`,`variable`,{string:s,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:t,string:s,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:`class-name`,greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:[`class-name`,`class-name-fully-qualified`],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,number:r,operator:i,punctuation:a}},delimiter:{pattern:/^#\[|\]$/,alias:`punctuation`}}}}),e.hooks.add(`before-tokenize`,function(t){/<\?/.test(t.code)&&e.languages[`markup-templating`].buildPlaceholders(t,`php`,/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g)}),e.hooks.add(`after-tokenize`,function(t){e.languages[`markup-templating`].tokenizePlaceholders(t,`php`)})})(e)}z_.displayName=`python`,z_.aliases=[`py`];function z_(e){e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:`punctuation`},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:`string`},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:[`annotation`,`punctuation`],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python[`string-interpolation`].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}B_.displayName=`r`,B_.aliases=[];function B_(e){e.languages.r={comment:/#.*/,string:{pattern:/(['"])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"percent-operator":{pattern:/%[^%\s]*%/,alias:`operator`},boolean:/\b(?:FALSE|TRUE)\b/,ellipsis:/\.\.(?:\.|\d+)/,number:[/\b(?:Inf|NaN)\b/,/(?:\b0x[\dA-Fa-f]+(?:\.\d*)?|\b\d+(?:\.\d*)?|\B\.\d+)(?:[EePp][+-]?\d+)?[iL]?/],keyword:/\b(?:NA|NA_character_|NA_complex_|NA_integer_|NA_real_|NULL|break|else|for|function|if|in|next|repeat|while)\b/,operator:/->?>?|<(?:=|<?-)?|[>=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/,punctuation:/[(){}\[\],;]/}}V_.displayName=`ruby`,V_.aliases=[`rb`];function V_(e){e.register(m_),(function(e){e.languages.ruby=e.languages.extend(`clike`,{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),e.languages.insertBefore(`ruby`,`operator`,{"double-colon":{pattern:/::/,alias:`punctuation`}});var t={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:e.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:`punctuation`}}};delete e.languages.ruby.function;var n=`(?:`+[`([^a-zA-Z0-9\\s{(\\[<=])(?:(?!\\1)[^\\\\]|\\\\[\\s\\S])*\\1`,`\\((?:[^()\\\\]|\\\\[\\s\\S]|\\((?:[^()\\\\]|\\\\[\\s\\S])*\\))*\\)`,`\\{(?:[^{}\\\\]|\\\\[\\s\\S]|\\{(?:[^{}\\\\]|\\\\[\\s\\S])*\\})*\\}`,`\\[(?:[^\\[\\]\\\\]|\\\\[\\s\\S]|\\[(?:[^\\[\\]\\\\]|\\\\[\\s\\S])*\\])*\\]`,`<(?:[^<>\\\\]|\\\\[\\s\\S]|<(?:[^<>\\\\]|\\\\[\\s\\S])*>)*>`].join(`|`)+`)`,r=`(?:"(?:\\\\.|[^"\\\\\\r\\n])*"|(?:\\b[a-zA-Z_]\\w*|[^\\s\\0-\\x7F]+)[?!]?|\\$.)`;e.languages.insertBefore(`ruby`,`keyword`,{"regex-literal":[{pattern:RegExp(`%r`+n+`[egimnosux]{0,6}`),greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(`(^|[^:]):`+r),lookbehind:!0,greedy:!0},{pattern:RegExp(`([\\r\\n{(,][ \\t]*)`+r+`(?=:(?!:))`),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),e.languages.insertBefore(`ruby`,`string`,{"string-literal":[{pattern:RegExp(`%[qQiIwWs]?`+n),greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:`heredoc-string`,greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:`heredoc-string`,greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(`%x`+n),greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:`string`}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:`string`}}}]}),delete e.languages.ruby.string,e.languages.insertBefore(`ruby`,`number`,{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),e.languages.rb=e.languages.ruby})(e)}H_.displayName=`rust`,H_.aliases=[];function H_(e){(function(e){for(var t=`\\/\\*(?:[^*/]|\\*(?!\\/)|\\/(?!\\*)|<self>)*\\*\\/`,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return`[^\\s\\S]`}),e.languages.rust={comment:[{pattern:RegExp(`(^|[^\\\\])`+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:`attr-name`,inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:`punctuation`},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:`symbol`},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:`punctuation`},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:`function`},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:`class-name`},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:`namespace`},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:`namespace`,inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:`property`},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust[`closure-params`].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string})(e)}U_.displayName=`sass`,U_.aliases=[];function U_(e){e.register(x_),(function(e){e.languages.sass=e.languages.extend(`css`,{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),e.languages.insertBefore(`sass`,`atrule`,{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete e.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,n=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];e.languages.insertBefore(`sass`,`property`,{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:t,operator:n}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:t,operator:n,important:e.languages.sass.important}}}),delete e.languages.sass.property,delete e.languages.sass.important,e.languages.insertBefore(`sass`,`punctuation`,{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})})(e)}W_.displayName=`scss`,W_.aliases=[];function W_(e){e.register(x_),e.languages.scss=e.languages.extend(`css`,{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:`important`},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),e.languages.insertBefore(`scss`,`atrule`,{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),e.languages.insertBefore(`scss`,`important`,{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),e.languages.insertBefore(`scss`,`function`,{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:`keyword`},placeholder:{pattern:/%[-\w]+/,alias:`selector`},statement:{pattern:/\B!(?:default|optional)\b/i,alias:`keyword`},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:`keyword`},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),e.languages.scss.atrule.inside.rest=e.languages.scss}G_.displayName=`sql`,G_.aliases=[];function G_(e){e.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}}K_.displayName=`swift`,K_.aliases=[];function K_(e){e.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(`(^|[^"#])(?:"(?:\\\\(?:\\((?:[^()]|\\([^()]*\\))*\\)|\\r\\n|[^(])|[^\\\\\\r\\n"])*"|"""(?:\\\\(?:\\((?:[^()]|\\([^()]*\\))*\\)|[^(])|[^\\\\"]|"(?!""))*""")(?!["#])`),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:`punctuation`},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(`(^|[^"#])(#+)(?:"(?:\\\\(?:#+\\((?:[^()]|\\([^()]*\\))*\\)|\\r\\n|[^#])|[^\\\\\\r\\n])*?"|"""(?:\\\\(?:#+\\((?:[^()]|\\([^()]*\\))*\\)|[^#])|[^\\\\])*?""")\\2`),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:`punctuation`},string:/[\s\S]+/}}],directive:{pattern:RegExp(`#(?:(?:elseif|if)\\b(?:[ ]*(?:![ \\t]*)?(?:\\b\\w+\\b(?:[ \\t]*\\((?:[^()]|\\([^()]*\\))*\\))?|\\((?:[^()]|\\([^()]*\\))*\\))(?:[ \\t]*(?:&&|\\|\\|))?)+|(?:else|endif)\\b)`),alias:`property`,inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:`constant`},"other-directive":{pattern:/#\w+\b/,alias:`property`},attribute:{pattern:/@\w+/,alias:`atrule`},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:`function`},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:`important`},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:`constant`},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:`keyword`},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},e.languages.swift[`string-literal`].forEach(function(t){t.inside.interpolation.inside=e.languages.swift})}q_.displayName=`typescript`,q_.aliases=[`ts`];function q_(e){e.register(D_),(function(e){e.languages.typescript=e.languages.extend(`javascript`,{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript[`literal-property`];var t=e.languages.extend(`typescript`,{});delete t[`class-name`],e.languages.typescript[`class-name`].inside=t,e.languages.insertBefore(`typescript`,`function`,{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:`operator`},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:t}}}}),e.languages.ts=e.languages.typescript})(e)}J_.displayName=`basic`,J_.aliases=[];function J_(e){e.languages.basic={comment:{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},string:{pattern:/"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SELECT CASE|SHARED|SHELL|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i,function:/\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i,operator:/<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i,punctuation:/[,;:()]/}}Y_.displayName=`vbnet`,Y_.aliases=[];function Y_(e){e.register(J_),e.languages.vbnet=e.languages.extend(`basic`,{comment:[{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},{pattern:/(^|[^\\:])'.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(^|[^"])"(?:""|[^"])*"(?!")/,lookbehind:!0,greedy:!0},keyword:/(?:\b(?:ADDHANDLER|ADDRESSOF|ALIAS|AND|ANDALSO|AS|BEEP|BLOAD|BOOLEAN|BSAVE|BYREF|BYTE|BYVAL|CALL(?: ABSOLUTE)?|CASE|CATCH|CBOOL|CBYTE|CCHAR|CDATE|CDBL|CDEC|CHAIN|CHAR|CHDIR|CINT|CLASS|CLEAR|CLNG|CLOSE|CLS|COBJ|COM|COMMON|CONST|CONTINUE|CSBYTE|CSHORT|CSNG|CSTR|CTYPE|CUINT|CULNG|CUSHORT|DATA|DATE|DECIMAL|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DEFAULT|DELEGATE|DIM|DIRECTCAST|DO|DOUBLE|ELSE|ELSEIF|END|ENUM|ENVIRON|ERASE|ERROR|EVENT|EXIT|FALSE|FIELD|FILES|FINALLY|FOR(?: EACH)?|FRIEND|FUNCTION|GET|GETTYPE|GETXMLNAMESPACE|GLOBAL|GOSUB|GOTO|HANDLES|IF|IMPLEMENTS|IMPORTS|IN|INHERITS|INPUT|INTEGER|INTERFACE|IOCTL|IS|ISNOT|KEY|KILL|LET|LIB|LIKE|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|ME|MKDIR|MOD|MODULE|MUSTINHERIT|MUSTOVERRIDE|MYBASE|MYCLASS|NAME|NAMESPACE|NARROWING|NEW|NEXT|NOT|NOTHING|NOTINHERITABLE|NOTOVERRIDABLE|OBJECT|OF|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPERATOR|OPTION(?: BASE)?|OPTIONAL|OR|ORELSE|OUT|OVERLOADS|OVERRIDABLE|OVERRIDES|PARAMARRAY|PARTIAL|POKE|PRIVATE|PROPERTY|PROTECTED|PUBLIC|PUT|RAISEEVENT|READ|READONLY|REDIM|REM|REMOVEHANDLER|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SBYTE|SELECT(?: CASE)?|SET|SHADOWS|SHARED|SHELL|SHORT|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|STRUCTURE|SUB|SWAP|SYNCLOCK|SYSTEM|THEN|THROW|TIMER|TO|TROFF|TRON|TRUE|TRY|TRYCAST|TYPE|TYPEOF|UINTEGER|ULONG|UNLOCK|UNTIL|USHORT|USING|VIEW PRINT|WAIT|WEND|WHEN|WHILE|WIDENING|WITH|WITHEVENTS|WRITE|WRITEONLY|XOR)|\B(?:#CONST|#ELSE|#ELSEIF|#END|#IF))(?:\$|\b)/i,punctuation:/[,;:(){}]/})}var X_=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};X_.prototype.normal={},X_.prototype.property={},X_.prototype.space=void 0;function Z_(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new X_(n,r,t)}function Q_(e){return e.toLowerCase()}var $_=class{constructor(e,t){this.attribute=t,this.property=e}};$_.prototype.attribute=``,$_.prototype.booleanish=!1,$_.prototype.boolean=!1,$_.prototype.commaOrSpaceSeparated=!1,$_.prototype.commaSeparated=!1,$_.prototype.defined=!1,$_.prototype.mustUseProperty=!1,$_.prototype.number=!1,$_.prototype.overloadedBoolean=!1,$_.prototype.property=``,$_.prototype.spaceSeparated=!1,$_.prototype.space=void 0;var ev=e.xt({boolean:()=>Z,booleanish:()=>nv,commaOrSpaceSeparated:()=>ov,commaSeparated:()=>av,number:()=>Q,overloadedBoolean:()=>rv,spaceSeparated:()=>iv}),tv=0,Z=sv(),nv=sv(),rv=sv(),Q=sv(),iv=sv(),av=sv(),ov=sv();function sv(){return 2**++tv}var cv=Object.keys(ev),lv=class extends $_{constructor(e,t,n,r){let i=-1;if(super(e,t),uv(this,`space`,r),typeof n==`number`)for(;++i<cv.length;){let e=cv[i];uv(this,cv[i],(n&ev[e])===ev[e])}}};lv.prototype.defined=!0;function uv(e,t,n){n&&(e[t]=n)}function dv(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new lv(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Q_(r)]=r,n[Q_(a.attribute)]=r}return new X_(t,n,e.space)}var fv=dv({properties:{ariaActiveDescendant:null,ariaAtomic:nv,ariaAutoComplete:null,ariaBusy:nv,ariaChecked:nv,ariaColCount:Q,ariaColIndex:Q,ariaColSpan:Q,ariaControls:iv,ariaCurrent:null,ariaDescribedBy:iv,ariaDetails:null,ariaDisabled:nv,ariaDropEffect:iv,ariaErrorMessage:null,ariaExpanded:nv,ariaFlowTo:iv,ariaGrabbed:nv,ariaHasPopup:null,ariaHidden:nv,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:iv,ariaLevel:Q,ariaLive:null,ariaModal:nv,ariaMultiLine:nv,ariaMultiSelectable:nv,ariaOrientation:null,ariaOwns:iv,ariaPlaceholder:null,ariaPosInSet:Q,ariaPressed:nv,ariaReadOnly:nv,ariaRelevant:null,ariaRequired:nv,ariaRoleDescription:iv,ariaRowCount:Q,ariaRowIndex:Q,ariaRowSpan:Q,ariaSelected:nv,ariaSetSize:Q,ariaSort:null,ariaValueMax:Q,ariaValueMin:Q,ariaValueNow:Q,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function pv(e,t){return t in e?e[t]:t}function mv(e,t){return pv(e,t.toLowerCase())}var hv=dv({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:av,acceptCharset:iv,accessKey:iv,action:null,allow:null,allowFullScreen:Z,allowPaymentRequest:Z,allowUserMedia:Z,alt:null,as:null,async:Z,autoCapitalize:null,autoComplete:iv,autoFocus:Z,autoPlay:Z,blocking:iv,capture:null,charSet:null,checked:Z,cite:null,className:iv,cols:Q,colSpan:null,content:null,contentEditable:nv,controls:Z,controlsList:iv,coords:Q|av,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Z,defer:Z,dir:null,dirName:null,disabled:Z,download:rv,draggable:nv,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Z,formTarget:null,headers:iv,height:Q,hidden:rv,high:Q,href:null,hrefLang:null,htmlFor:iv,httpEquiv:iv,id:null,imageSizes:null,imageSrcSet:null,inert:Z,inputMode:null,integrity:null,is:null,isMap:Z,itemId:null,itemProp:iv,itemRef:iv,itemScope:Z,itemType:iv,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Z,low:Q,manifest:null,max:null,maxLength:Q,media:null,method:null,min:null,minLength:Q,multiple:Z,muted:Z,name:null,nonce:null,noModule:Z,noValidate:Z,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Z,optimum:Q,pattern:null,ping:iv,placeholder:null,playsInline:Z,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Z,referrerPolicy:null,rel:iv,required:Z,reversed:Z,rows:Q,rowSpan:Q,sandbox:iv,scope:null,scoped:Z,seamless:Z,selected:Z,shadowRootClonable:Z,shadowRootDelegatesFocus:Z,shadowRootMode:null,shape:null,size:Q,sizes:null,slot:null,span:Q,spellCheck:nv,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Q,step:null,style:null,tabIndex:Q,target:null,title:null,translate:null,type:null,typeMustMatch:Z,useMap:null,value:nv,width:Q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:iv,axis:null,background:null,bgColor:null,border:Q,borderColor:null,bottomMargin:Q,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Z,declare:Z,event:null,face:null,frame:null,frameBorder:null,hSpace:Q,leftMargin:Q,link:null,longDesc:null,lowSrc:null,marginHeight:Q,marginWidth:Q,noResize:Z,noHref:Z,noShade:Z,noWrap:Z,object:null,profile:null,prompt:null,rev:null,rightMargin:Q,rules:null,scheme:null,scrolling:nv,standby:null,summary:null,text:null,topMargin:Q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Q,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Z,disableRemotePlayback:Z,prefix:null,property:null,results:Q,security:null,unselectable:null},space:`html`,transform:mv}),gv=dv({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:ov,accentHeight:Q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Q,amplitude:Q,arabicForm:null,ascent:Q,attributeName:null,attributeType:null,azimuth:Q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Q,by:null,calcMode:null,capHeight:Q,className:iv,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Q,diffuseConstant:Q,direction:null,display:null,dur:null,divisor:Q,dominantBaseline:null,download:Z,dx:null,dy:null,edgeMode:null,editable:null,elevation:Q,enableBackground:null,end:null,event:null,exponent:Q,externalResourcesRequired:null,fill:null,fillOpacity:Q,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:av,g2:av,glyphName:av,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Q,horizOriginX:Q,horizOriginY:Q,id:null,ideographic:Q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Q,k:Q,k1:Q,k2:Q,k3:Q,k4:Q,kernelMatrix:ov,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Q,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Q,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Q,overlineThickness:Q,paintOrder:null,panose1:null,path:null,pathLength:Q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:iv,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Q,pointsAtY:Q,pointsAtZ:Q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ov,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ov,rev:ov,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ov,requiredFeatures:ov,requiredFonts:ov,requiredFormats:ov,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Q,specularExponent:Q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Q,strikethroughThickness:Q,string:null,stroke:null,strokeDashArray:ov,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Q,strokeOpacity:Q,strokeWidth:null,style:null,surfaceScale:Q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ov,tabIndex:Q,tableValues:null,target:null,targetX:Q,targetY:Q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ov,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Q,underlineThickness:Q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Q,values:null,vAlphabetic:Q,vMathematical:Q,vectorEffect:null,vHanging:Q,vIdeographic:Q,version:null,vertAdvY:Q,vertOriginX:Q,vertOriginY:Q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:pv}),_v=dv({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),vv=dv({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:mv}),yv=dv({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),bv=/[A-Z]/g,xv=/-[a-z]/g,Sv=/^data[-\w.:]+$/i;function Cv(e,t){let n=Q_(t),r=t,i=$_;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Sv.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(xv,Tv);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!xv.test(e)){let n=e.replace(bv,wv);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=lv}return new i(r,t)}function wv(e){return`-`+e.toLowerCase()}function Tv(e){return e.charAt(1).toUpperCase()}var Ev=Z_([fv,hv,_v,vv,yv],`html`),Dv=Z_([fv,gv,_v,vv,yv],`svg`);function Ov(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}var kv=/[#.]/g;function Av(e,t){let n=e||``,r={},i=0,a,o;for(;i<n.length;){kv.lastIndex=i;let e=kv.exec(n),t=n.slice(i,e?e.index:n.length);t&&(a?a===`#`?r.id=t:Array.isArray(r.className)?r.className.push(t):r.className=[t]:o=t,i+=t.length),e&&(a=e[0],i++)}return{type:`element`,tagName:o||t||`div`,properties:r,children:[]}}function jv(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Mv(e,t,n){let r=n?Rv(n):void 0;function i(n,i,...a){let o;if(n==null){o={type:`root`,children:[]};let e=i;a.unshift(e)}else{o=Av(n,t);let s=o.tagName.toLowerCase(),c=r?r.get(s):void 0;if(o.tagName=c||s,Nv(i))a.unshift(i);else for(let[t,n]of Object.entries(i))Pv(e,o.properties,t,n)}for(let e of a)Fv(o.children,e);return o.type===`element`&&o.tagName===`template`&&(o.content={type:`root`,children:o.children},o.children=[]),o}return i}function Nv(e){if(typeof e!=`object`||!e||Array.isArray(e))return!0;if(typeof e.type!=`string`)return!1;let t=e,n=Object.keys(e);for(let e of n){let n=t[e];if(n&&typeof n==`object`){if(!Array.isArray(n))return!0;let e=n;for(let t of e)if(typeof t!=`number`&&typeof t!=`string`)return!0}}return!!(`children`in e&&Array.isArray(e.children))}function Pv(e,t,n,r){let i=Cv(e,n),a;if(r!=null){if(typeof r==`number`){if(Number.isNaN(r))return;a=r}else a=typeof r==`boolean`?r:typeof r==`string`?i.spaceSeparated?jv(r):i.commaSeparated?Ov(r):i.commaOrSpaceSeparated?jv(Ov(r).join(` `)):Iv(i,i.property,r):Array.isArray(r)?[...r]:i.property===`style`?Lv(r):String(r);if(Array.isArray(a)){let e=[];for(let t of a)e.push(Iv(i,i.property,t));a=e}i.property===`className`&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function Fv(e,t){if(t!=null)if(typeof t==`number`||typeof t==`string`)e.push({type:`text`,value:String(t)});else if(Array.isArray(t))for(let n of t)Fv(e,n);else if(typeof t==`object`&&`type`in t)t.type===`root`?Fv(e,t.children):e.push(t);else throw Error("Expected node, nodes, or string, got `"+t+"`")}function Iv(e,t,n){if(typeof n==`string`){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===``||Q_(n)===Q_(t)))return!0}return n}function Lv(e){let t=[];for(let[n,r]of Object.entries(e))t.push([n,r].join(`: `));return t.join(`; `)}function Rv(e){let t=new Map;for(let n of e)t.set(n.toLowerCase(),n);return t}var zv=`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.solidColor.textArea.textPath`.split(`.`),Bv=Mv(Ev,`div`);Mv(Dv,`g`,zv);var Vv=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),Hv={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function Uv(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function Wv(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function Gv(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function Kv(e){return Gv(e)||Uv(e)}var qv=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function Jv(t,n){let r=n||{},i=typeof r.additional==`string`?r.additional.charCodeAt(0):r.additional,a=[],o=0,s=-1,c=``,l,u;r.position&&(`start`in r.position||`indent`in r.position?(u=r.position.indent,l=r.position.start):l=r.position);let d=(l?l.line:0)||1,f=(l?l.column:0)||1,p=h(),m;for(o--;++o<=t.length;)if(m===10&&(f=(u?u[s]:0)||1),m=t.charCodeAt(o),m===38){let n=t.charCodeAt(o+1);if(n===9||n===10||n===12||n===32||n===38||n===60||Number.isNaN(n)||i&&n===i){c+=String.fromCharCode(m),f++;continue}let s=o+1,l=s,u=s,d;if(n===35){u=++l;let e=t.charCodeAt(u);e===88||e===120?(d=`hexadecimal`,u=++l):d=`decimal`}else d=`named`;let v=``,y=``,b=``,x=d===`named`?Kv:d===`decimal`?Uv:Wv;for(u--;++u<=t.length;){let n=t.charCodeAt(u);if(!x(n))break;b+=String.fromCharCode(n),d===`named`&&Vv.includes(b)&&(v=b,y=e.ht(b))}let S=t.charCodeAt(u)===59;if(S){u++;let t=d===`named`?e.ht(b):!1;t&&(v=b,y=t)}let C=1+u-s,w=``;if(!(!S&&r.nonTerminated===!1))if(!b)d!==`named`&&g(4,C);else if(d===`named`){if(S&&!y)g(5,1);else if(v!==b&&(u=l+v.length,C=1+u-l,S=!1),!S){let e=v?1:3;if(r.attribute){let n=t.charCodeAt(u);n===61?(g(e,C),y=``):Kv(n)?y=``:g(e,C)}else g(e,C)}w=y}else{S||g(2,C);let e=Number.parseInt(b,d===`hexadecimal`?16:10);if(Yv(e))g(7,C),w=`�`;else if(e in Hv)g(6,C),w=Hv[e];else{let t=``;Xv(e)&&g(6,C),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),w=t+String.fromCharCode(e)}}if(w){_(),p=h(),o=u-1,f+=u-s+1,a.push(w);let e=h();e.offset++,r.reference&&r.reference.call(r.referenceContext||void 0,w,{start:p,end:e},t.slice(s-1,u)),p=e}else b=t.slice(s-1,u),c+=b,f+=b.length,o=u-1}else m===10&&(d++,s++,f=0),Number.isNaN(m)?_():(c+=String.fromCharCode(m),f++);return a.join(``);function h(){return{line:d,column:f,offset:o+((l?l.offset:0)||0)}}function g(e,t){let n;r.warning&&(n=h(),n.column+=t,n.offset+=t,r.warning.call(r.warningContext||void 0,qv[e],n,e))}function _(){c&&=(a.push(c),r.text&&r.text.call(r.textContext||void 0,c,{start:p,end:h()}),``)}}function Yv(e){return e>=55296&&e<=57343||e>1114111}function Xv(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}var Zv=0,Qv={},$v={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++Zv}),e.__id},clone:function e(t,n){n||={};var r,i;switch($v.util.type(t)){case`Object`:if(i=$v.util.objId(t),n[i])return n[i];for(var a in r={},n[i]=r,t)t.hasOwnProperty(a)&&(r[a]=e(t[a],n));return r;case`Array`:return i=$v.util.objId(t),n[i]?n[i]:(r=[],n[i]=r,t.forEach(function(t,i){r[i]=e(t,n)}),r);default:return t}}},languages:{plain:Qv,plaintext:Qv,text:Qv,txt:Qv,extend:function(e,t){var n=$v.util.clone($v.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){r||=$v.languages;var i=r[e],a={};for(var o in i)if(i.hasOwnProperty(o)){if(o==t)for(var s in n)n.hasOwnProperty(s)&&(a[s]=n[s]);n.hasOwnProperty(o)||(a[o]=i[o])}var c=r[e];return r[e]=a,$v.languages.DFS($v.languages,function(t,n){n===c&&t!=e&&(this[t]=a)}),a},DFS:function e(t,n,r,i){i||={};var a=$v.util.objId;for(var o in t)if(t.hasOwnProperty(o)){n.call(t,o,t[o],r||o);var s=t[o],c=$v.util.type(s);c===`Object`&&!i[a(s)]?(i[a(s)]=!0,e(s,n,null,i)):c===`Array`&&!i[a(s)]&&(i[a(s)]=!0,e(s,n,o,i))}}},plugins:{},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if($v.hooks.run(`before-tokenize`,r),!r.grammar)throw Error(`The language "`+r.language+`" has no grammar.`);return r.tokens=$v.tokenize(r.code,r.grammar),$v.hooks.run(`after-tokenize`,r),ey.stringify($v.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new ry;return iy(i,i.head,e),ny(e,i,t,i.head,0),oy(i)},hooks:{all:{},add:function(e,t){var n=$v.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=$v.hooks.all[e];if(!(!n||!n.length))for(var r=0,i;i=n[r++];)i(t)}},Token:ey};function ey(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||``).length|0}function ty(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var a=i[1].length;i.index+=a,i[0]=i[0].slice(a)}return i}function ny(e,t,n,r,i,a){for(var o in n)if(!(!n.hasOwnProperty(o)||!n[o])){var s=n[o];s=Array.isArray(s)?s:[s];for(var c=0;c<s.length;++c){if(a&&a.cause==o+`,`+c)return;var l=s[c],u=l.inside,d=!!l.lookbehind,f=!!l.greedy,p=l.alias;if(f&&!l.pattern.global){var m=l.pattern.toString().match(/[imsuy]*$/)[0];l.pattern=RegExp(l.pattern.source,m+`g`)}for(var h=l.pattern||l,g=r.next,_=i;g!==t.tail&&!(a&&_>=a.reach);_+=g.value.length,g=g.next){var v=g.value;if(t.length>e.length)return;if(!(v instanceof ey)){var y=1,b;if(f){if(b=ty(h,_,e,d),!b||b.index>=e.length)break;var x=b.index,S=b.index+b[0].length,C=_;for(C+=g.value.length;x>=C;)g=g.next,C+=g.value.length;if(C-=g.value.length,_=C,g.value instanceof ey)continue;for(var w=g;w!==t.tail&&(C<S||typeof w.value==`string`);w=w.next)y++,C+=w.value.length;y--,v=e.slice(_,C),b.index-=_}else if(b=ty(h,0,v,d),!b)continue;var x=b.index,T=b[0],E=v.slice(0,x),ee=v.slice(x+T.length),te=_+v.length;a&&te>a.reach&&(a.reach=te);var D=g.prev;E&&(D=iy(t,D,E),_+=E.length),ay(t,D,y);var ne=new ey(o,u?$v.tokenize(T,u):T,p,T);if(g=iy(t,D,ne),ee&&iy(t,g,ee),y>1){var re={cause:o+`,`+c,reach:te};ny(e,t,n,g.prev,_,re),a&&re.reach>a.reach&&(a.reach=re.reach)}}}}}}function ry(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function iy(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function ay(e,t,n){for(var r=t.next,i=0;i<n&&r!==e.tail;i++)r=r.next;t.next=r,r.prev=t,e.length-=i}function oy(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}var sy=$v;function cy(){}cy.prototype=sy;var $=new cy;$.highlight=ly,$.register=uy,$.alias=dy,$.registered=fy,$.listLanguages=py,$.util.encode=hy,$.Token.stringify=my;function ly(e,t){if(typeof e!=`string`)throw TypeError("Expected `string` for `value`, got `"+e+"`");let n,r;if(t&&typeof t==`object`)n=t;else{if(r=t,typeof r!=`string`)throw TypeError("Expected `string` for `name`, got `"+r+"`");if(Object.hasOwn($.languages,r))n=$.languages[r];else throw Error("Unknown language: `"+r+"` is not registered")}return{type:`root`,children:sy.highlight.call($,e,n,r)}}function uy(e){if(typeof e!=`function`||!e.displayName)throw Error("Expected `function` for `syntax`, got `"+e+"`");Object.hasOwn($.languages,e.displayName)||e($)}function dy(e,t){let n=$.languages,r={};typeof e==`string`?t&&(r[e]=t):r=e;let i;for(i in r)if(Object.hasOwn(r,i)){let e=r[i],t=typeof e==`string`?[e]:e,a=-1;for(;++a<t.length;)n[t[a]]=n[i]}}function fy(e){if(typeof e!=`string`)throw TypeError("Expected `string` for `aliasOrLanguage`, got `"+e+"`");return Object.hasOwn($.languages,e)}function py(){let e=$.languages,t=[],n;for(n in e)Object.hasOwn(e,n)&&typeof e[n]==`object`&&t.push(n);return t}function my(e,t){if(typeof e==`string`)return{type:`text`,value:e};if(Array.isArray(e)){let n=[],r=-1;for(;++r<e.length;)e[r]!==null&&e[r]!==void 0&&e[r]!==``&&n.push(my(e[r],t));return n}let n={attributes:{},classes:[`token`,e.type],content:my(e.content,t),language:t,tag:`span`,type:e.type};return e.alias&&n.classes.push(...typeof e.alias==`string`?[e.alias]:e.alias),$.hooks.run(`wrap`,n),Bv(n.tag+`.`+n.classes.join(`.`),gy(n.attributes),n.content)}function hy(e){return e}function gy(e){let t;for(t in e)Object.hasOwn(e,t)&&(e[t]=Jv(e[t]));return e}$.register(m_),$.register(h_),$.register(g_),$.register(__),$.register(v_),$.register(y_),$.register(b_),$.register(x_),$.register(S_),$.register(C_),$.register(w_),$.register(T_),$.register(E_),$.register(D_),$.register(O_),$.register(k_),$.register(A_),$.register(j_),$.register(M_),$.register(N_),$.register(P_),$.register(F_),$.register(I_),$.register(L_),$.register(R_),$.register(z_),$.register(B_),$.register(V_),$.register(H_),$.register(U_),$.register(W_),$.register(G_),$.register(K_),$.register(q_),$.register(J_),$.register(Y_);function _y({...e}){return(0,m.jsx)(Os,{"data-slot":`popover`,...e})}function vy({...e}){return(0,m.jsx)(ks,{"data-slot":`popover-trigger`,...e})}function yy({container:e,className:t,align:n=`center`,sideOffset:r=4,...i}){return(0,m.jsx)(As,{container:e??void 0,children:(0,m.jsx)(js,{"data-slot":`popover-content`,align:n,sideOffset:r,className:il(`z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,t),...i})})}var by=new Set,xy=!1,Sy=()=>typeof document<`u`,Cy=e=>{Array.from(by).forEach(t=>t(e))},wy=()=>{xy||!Sy()||(document.addEventListener(`scroll`,Cy,{capture:!0,passive:!0}),xy=!0)},Ty=()=>{!xy||!Sy()||(document.removeEventListener(`scroll`,Cy,!0),xy=!1)},Ey=e=>{if(!Sy())return()=>void 0;let t=!0;return by.add(e),wy(),()=>{t&&(t=!1,by.delete(e),by.size===0&&Ty())}},Dy=(e,t,n)=>{let r=(0,u.useRef)(t),i=(0,u.useRef)(n);(0,u.useEffect)(()=>{r.current=t},[t]),(0,u.useEffect)(()=>{i.current=n},[n]),(0,u.useEffect)(()=>e?Ey(e=>{i.current?.(e)||r.current()}):void 0,[e])},Oy=e=>e?e.closest(`.zt-md-editor`)??e:null,ky=(e,t)=>{let n=typeof window>`u`?e.bottom:window.innerHeight,r=e.top,i=n-e.bottom;return i<t&&r>i?`top`:`bottom`},Ay=(e,t)=>{let n=t.getBoundingClientRect();return{anchorTopInContent:e.top-n.top+t.scrollTop,anchorBottomInContent:e.bottom-n.top+t.scrollTop,anchorLeftInContent:e.left-n.left+t.scrollLeft}},jy=e=>{let{wrapper:t,anchor:n,overlaySize:r,placement:i,offsetY:a,boundaryInset:o}=e,s=t.getBoundingClientRect(),c=t.scrollLeft+o,l=t.scrollLeft+t.clientWidth-r.width-o,u=Math.min(Math.max(n.anchorLeftInContent,c),Math.max(c,l)),d=i===`top`?n.anchorTopInContent-a:n.anchorBottomInContent+a;return{left:s.left+u-t.scrollLeft,top:s.top+d-t.scrollTop}},My=(e,t)=>{let n=jy(e),r=t.getBoundingClientRect();return{left:n.left-r.left,top:n.top-r.top}},Ny=e=>{let t=0,n=null,r=null,i=()=>{typeof window>`u`||(t&&window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{t=0,e()}))},a=()=>{window.addEventListener(`resize`,i),r||=Ey(i)},o=()=>{window.removeEventListener(`resize`,i),r?.(),r=null},s=e=>{n!==e&&(n&&n.removeEventListener(`scroll`,i),n=e,n&&n.addEventListener(`scroll`,i,{passive:!0}))};return{schedule:i,bindGlobal:a,unbindGlobal:o,bindWrapper:s,destroy:()=>{typeof window<`u`&&t&&(window.cancelAnimationFrame(t),t=0),o(),s(null)}}},Py=`code_block`,Fy=`ZT_MD_CODE_BLOCK_LANGUAGE_PICKER`,Iy=104,Ly=36,Ry=`text`,zy={javascript:`JavaScript`,typescript:`TypeScript`,jsx:`JSX`,tsx:`TSX`,json:`JSON`,html:`HTML`,css:`CSS`,bash:`Bash`,shell:`Shell`,sh:`Shell`,markdown:`Markdown`,md:`Markdown`,yaml:`YAML`,yml:`YAML`,sql:`SQL`,xml:`XML`},By=e=>e.trim().toLowerCase()||Ry,Vy=e=>{let t=By(e);return zy[t]??t},Hy=e=>{let t=$.listLanguages(),n=[...new Set(t.map(e=>By(e)).filter(e=>e!==Ry))].sort((e,t)=>e.localeCompare(t));return[{value:Ry,label:e.codeBlockLanguagePlainText},...n.map(e=>({value:e,label:Vy(e)}))]},Uy=e=>{let t=e.state.selection.$from;for(let e=t.depth;e>=0;--e){let n=t.node(e);if(n.type.name===Py)return{position:e===0?0:t.before(e),node:n}}return null},Wy=(e,t)=>{let n=e.nodeDOM(t);return n instanceof HTMLPreElement?n:n instanceof HTMLElement?n.querySelector(`pre`):null},Gy=e=>typeof e.props.editable==`function`?e.props.editable(e.state):e.editable,Ky=e=>{let[t,n]=(0,u.useState)(!1),[r,i]=(0,u.useState)(``),a=By(e.currentLanguage),o=Vy(a),s=(0,u.useMemo)(()=>Hy(e.messages),[e.messages]),c=(0,u.useMemo)(()=>{let e=r.trim().toLowerCase();return e?s.filter(t=>{let n=t.label.toLowerCase(),r=t.value.toLowerCase();return n.includes(e)||r.includes(e)}):s},[r,s]);(0,u.useEffect)(()=>{n(!1),i(``)},[e.currentLanguage]);let l=e=>e instanceof HTMLElement?e.closest(`input, textarea, [contenteditable]:not([contenteditable="false"])`)!==null:!1,d=e=>{l(e.target)||e.preventDefault()},f=e=>{e.preventDefault()},p=t=>{e.onSelectLanguage(t),n(!1),i(``)};return Dy(t,()=>{n(!1)},e=>e.target instanceof HTMLElement?e.target.closest(`.zt-md-code-language-picker-panel`)!==null:!1),(0,u.createElement)(_y,{open:t,onOpenChange:n},(0,u.createElement)(`div`,{className:`zt-md-code-language-picker`,onMouseDown:d},(0,u.createElement)(vy,{asChild:!0},(0,u.createElement)(`button`,{type:`button`,className:`zt-md-code-language-picker-trigger`,"aria-expanded":t,"aria-label":o},(0,u.createElement)(`span`,{className:`zt-md-code-language-picker-trigger-label`},o),(0,u.createElement)(Ce,{className:`zt-md-code-language-picker-trigger-icon`,size:14,strokeWidth:2,"aria-hidden":`true`}))),(0,u.createElement)(yy,{align:`end`,side:`bottom`,sideOffset:6,className:`zt-md-code-language-picker-panel`,container:e.portalContainer,onOpenAutoFocus:f,onCloseAutoFocus:f},(0,u.createElement)(`label`,{className:`zt-md-code-language-picker-search`},(0,u.createElement)(Ke,{className:`zt-md-code-language-picker-search-icon`,size:14,strokeWidth:2,"aria-hidden":`true`}),(0,u.createElement)(`input`,{value:r,onChange:e=>i(e.currentTarget.value),placeholder:e.messages.codeBlockLanguageSearchPlaceholder,className:`zt-md-code-language-picker-search-input`})),(0,u.createElement)(`div`,{className:`zt-md-code-language-picker-options`,role:`listbox`},c.length>0?c.map(e=>(0,u.createElement)(`button`,{key:e.value||`__plain_text__`,type:`button`,className:`zt-md-code-language-picker-option`,"data-selected":e.value===a?`true`:`false`,onClick:()=>p(e.value)},(0,u.createElement)(`span`,null,e.label),e.value===a?(0,u.createElement)(Se,{className:`zt-md-code-language-picker-option-check`,size:14,strokeWidth:2,"aria-hidden":`true`}):null)):(0,u.createElement)(`div`,{className:`zt-md-code-language-picker-empty`},`-`)))))},qy=class{constructor(e,t,n){this.currentCodeBlockPosition=null,this.currentPreElement=null,this.currentRenderedLanguage=null,this.hasPositionContext=!1,this.repositionScheduler=Ny(()=>{this.hasPositionContext&&this.updateOverlayPosition()}),this.view=e,this.messages=t,this.portalContainer=n,this.editorWrapper=Oy(e.dom),this.host=document.createElement(`span`),this.host.className=`zt-md-code-language-picker-host`,this.hostRoot=(0,f.createRoot)(this.host),this.repositionScheduler.bindGlobal(),this.repositionScheduler.bindWrapper(this.editorWrapper),this.update(e)}applyLanguage(e){if(this.currentCodeBlockPosition===null)return;let t=this.view.state.doc.nodeAt(this.currentCodeBlockPosition);if(!t||t.type.name!==Py)return;let n=By(e),r={...t.attrs,language:n};if(By(String(t.attrs.language??``))===n)return;let i=this.view.state.tr.setNodeMarkup(this.currentCodeBlockPosition,t.type,r,t.marks);this.view.dispatch(i),this.view.focus()}render(e){this.currentRenderedLanguage!==null&&this.currentRenderedLanguage===e||(this.hostRoot.render((0,u.createElement)(Ky,{currentLanguage:e,messages:this.messages,portalContainer:this.portalContainer,onSelectLanguage:e=>this.applyLanguage(e)})),this.host.dataset.mounted=`true`,this.currentRenderedLanguage=e)}detach(){this.hostRoot.render(null),delete this.host.dataset.mounted,this.host.remove(),this.currentCodeBlockPosition=null,this.currentPreElement=null,this.currentRenderedLanguage=null,this.hasPositionContext=!1}updateOverlayPosition(){if(!this.editorWrapper||!this.currentPreElement||this.host.parentElement!==this.portalContainer)return;let e=this.currentPreElement.getBoundingClientRect(),t=Ay(e,this.editorWrapper),n=My({wrapper:this.editorWrapper,anchor:{anchorLeftInContent:t.anchorLeftInContent+e.width-Iy,anchorTopInContent:t.anchorTopInContent+e.height-Ly,anchorBottomInContent:t.anchorTopInContent+e.height-Ly},overlaySize:{width:96},placement:`top`,offsetY:0,boundaryInset:2},this.portalContainer);this.host.style.left=`${n.left}px`,this.host.style.top=`${n.top}px`}update(e){if(this.view=e,!Gy(e)||!this.editorWrapper){this.detach();return}let t=Uy(e);if(!t){this.detach();return}let n=Wy(e,t.position);if(!n){this.detach();return}this.host.parentElement!==this.portalContainer&&this.portalContainer.append(this.host);let r=By(String(t.node.attrs.language??``)),i=this.currentCodeBlockPosition===t.position&&this.currentPreElement===n&&this.currentRenderedLanguage!==null&&this.currentRenderedLanguage===r;this.currentCodeBlockPosition=t.position,this.currentPreElement=n,this.hasPositionContext=!0,this.updateOverlayPosition(),this.repositionScheduler.schedule(),!i&&this.render(r)}destroy(){this.detach(),this.repositionScheduler.destroy(),this.hostRoot.unmount()}},Jy=(e,n)=>r.u(()=>new t.i({key:new t.a(Fy),view:t=>new qy(t,e,n)})),Yy=`code_block`,Xy=`a`,Zy=`zt-md-code-block-mod-a-select`,Qy=e=>e.key.toLowerCase()!==Xy||e.defaultPrevented||e.altKey||e.shiftKey||!e.ctrlKey&&!e.metaKey,$y=e=>{for(let t=e.depth;t>=0;--t){let n=e.node(t);if(n.type.name!==Yy)continue;let r=t===0?0:e.before(t);return{codeBlockStart:r+1,codeBlockEnd:r+n.nodeSize-1}}return null},eb=(e,n)=>{let r=e.state.selection.$from,i=$y(r);if(!i)return!1;let a=e.state.tr.setSelection(t.c.create(e.state.doc,i.codeBlockStart,i.codeBlockEnd));return n.preventDefault(),e.dispatch(a),!0},tb=r.u(()=>new t.i({key:new t.a(Zy),props:{handleKeyDown:(e,t)=>Qy(t)?!1:eb(e,t)}})),nb=`code_block`,rb=`ZT_MD_CODE_BLOCK_PRISM`,ib=(e,t=[])=>e.flatMap(e=>{if(e.type===`element`){let n=[...t,...e.properties?.className??[]];return ib(e.children??[],n)}return[{text:e.value??``,className:t}]}),ab=(e,t)=>t.listLanguages().includes(e),ob=(t,n)=>{let r=[];return e.F(e=>e.type.name===nb)(t).forEach(t=>{let i=String(t.node.attrs.language??``);if(!i||!ab(i,n))return;let a=t.pos+1;ib(n.highlight(t.node.textContent,i).children).forEach(t=>{let n=a+t.text.length;t.className.length>0&&r.push(e.j.inline(a,n,{class:t.className.join(` `)})),a=n})}),e.M.create(t,r)},sb=r.u(()=>{let e=$;return new t.i({key:new t.a(rb),state:{init:(t,n)=>ob(n.doc,e),apply:(t,n)=>t.docChanged?ob(t.doc,e):n.map(t.mapping,t.doc)},props:{decorations(e){return this.getState(e)}}})}),cb=`Expected a function`;function lb(e,t,n){var r=!0,i=!0;if(typeof e!=`function`)throw TypeError(cb);return s.n(n)&&(r=`leading`in n?!!n.leading:r,i=`trailing`in n?!!n.trailing:i),s.t(e,t,{leading:r,maxWait:t,trailing:i})}var ub=class{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;constructor(n){this.#a=!1,this.onShow=()=>{},this.onHide=()=>{},this.#u=e=>{o.r(e,this.element,{placement:this.#r.placement??`top`,middleware:[o.i(),o.s(this.#s),o.c(this.#c),...this.#n],...this.#r}).then(({x:e,y:t})=>{Object.assign(this.element.style,{left:`${e}px`,top:`${t}px`})}).catch(console.error)},this.#d=e=>this.#i!==e.dom.parentElement,this.#f=(t,n)=>{let{state:r,composing:i}=t,{selection:a,doc:s}=r,{ranges:c}=a,l=Math.min(...c.map(e=>e.$from.pos)),u=Math.max(...c.map(e=>e.$to.pos)),d=n&&n.doc.eq(s)&&n.selection.eq(a);if(this.#a||=((this.#i??t.dom.parentElement??document.body).appendChild(this.element),!0),i||d)return;if(this.#o?.(),this.#o=void 0,!this.#t(t,n)){this.hide();return}let f={getBoundingClientRect:()=>e.U(t,l,u),contextElement:t.dom};this.#d(t)?this.#o=o.n(f,this.element,()=>this.#u(f)):this.#u(f),this.show()},this.update=(e,t)=>{this.#l(e,t)},this.#p=e=>{let{doc:n,selection:r}=e.state,{empty:i,from:a,to:o}=r,s=!n.textBetween(a,o).length&&e.state.selection instanceof t.c,c=this.element.contains(document.activeElement),l=!e.hasFocus()&&!c,u=!e.editable;return!(l||i||s||u)},this.destroy=()=>{this.#o?.(),this.#l.cancel()},this.show=(e,t)=>{if(this.element.dataset.show=`true`,e){this.#o?.(),this.#o=void 0;let n={...e,contextElement:t?.dom};t&&this.#d(t)?this.#o=o.n(n,this.element,()=>this.#u(n)):this.#u(n)}this.onShow()},this.hide=()=>{this.element.dataset.show!==`false`&&(this.element.dataset.show=`false`,this.onHide())},this.element=n.content,this.#e=n.debounce??200,this.#t=n.shouldShow??this.#p,this.#s=n.offset,this.#c=n.shift,this.#n=n.middleware??[],this.#r=n.floatingUIOptions??{},this.#i=n.root,this.element.dataset.show=`false`,this.#l=lb(this.#f,this.#e)}#u;#d;#f;#p},db=`zt-md-selection-tooltip`,fb=e=>[{command:`strong`,icon:xe,title:e.selectionTooltipStrongTitle,markNames:[`strong`]},{command:`em`,icon:ze,title:e.selectionTooltipEmTitle,markNames:[`em`,`emphasis`]},{command:`strike`,icon:Xe,title:e.selectionTooltipStrikeTitle,markNames:[`strike_through`,`strikeThrough`]},{command:`inlineCode`,icon:Ee,title:e.selectionTooltipInlineCodeTitle,markNames:[`inlineCode`,`code_inline`]},{command:`link`,icon:Be,title:e.selectionTooltipLinkTitle,markNames:[`link`]}],pb={paragraph:rt,heading1:Ae,heading2:je,heading3:Me,heading4:Ne,heading5:Fe,heading6:Pe,bulletList:We,orderedList:He,taskList:Ve,blockquote:tt,codeBlock:Ee},mb=e=>[{command:`paragraph`,icon:pb.paragraph,label:e.selectionTooltipTransformParagraphLabel},{command:`heading1`,icon:pb.heading1,label:e.selectionTooltipTransformHeading1Label},{command:`heading2`,icon:pb.heading2,label:e.selectionTooltipTransformHeading2Label},{command:`heading3`,icon:pb.heading3,label:e.selectionTooltipTransformHeading3Label},{command:`heading4`,icon:pb.heading4,label:e.selectionTooltipTransformHeading4Label},{command:`heading5`,icon:pb.heading5,label:e.selectionTooltipTransformHeading5Label},{command:`heading6`,icon:pb.heading6,label:e.selectionTooltipTransformHeading6Label},{command:`bulletList`,icon:pb.bulletList,label:e.selectionTooltipTransformBulletListLabel},{command:`orderedList`,icon:pb.orderedList,label:e.selectionTooltipTransformOrderedListLabel},{command:`taskList`,icon:pb.taskList,label:e.selectionTooltipTransformTaskListLabel},{command:`blockquote`,icon:pb.blockquote,label:e.selectionTooltipTransformBlockquoteLabel},{command:`codeBlock`,icon:pb.codeBlock,label:e.selectionTooltipTransformCodeBlockLabel}],hb=(e,t)=>e(t.state,t.dispatch,t),gb=(e,t)=>{let n=e?.state?.selection?.$from;if(!n||!e?.dispatch)return!1;for(let r=n.depth;r>0;--r){let i=n.node(r);if(i?.type?.name!==`list_item`)continue;if(!i.type?.spec?.attrs?.checked)return!1;let a=n.before(r);return e.dispatch(e.state.tr.setNodeMarkup(a,void 0,{...i.attrs,checked:t})),!0}return!1},_b={heading1:1,heading2:2,heading3:3,heading4:4,heading5:5,heading6:6},vb={bulletList:`bullet_list`,orderedList:`ordered_list`},yb=[`codeBlock`,`heading1`,`heading2`,`heading3`,`heading4`,`heading5`,`heading6`,`taskList`,`orderedList`,`bulletList`,`blockquote`,`paragraph`],bb=async(e,t)=>{if(!e?.state||!e?.dispatch)return!1;let n=await Promise.resolve().then(()=>require("./commands-f4yOm8DQ.cjs")),r=await Promise.resolve().then(()=>require("./schema-list-CFEw5DQ8.cjs")).then(e=>e.t),i=n.setBlockType,a=n.wrapIn,o=r.wrapInList;if(typeof i!=`function`||typeof a!=`function`||typeof o!=`function`)return!1;let s=e.state.schema.nodes;if(t===`paragraph`){let t=s.paragraph;return t?hb(i(t),e):!1}if(t in _b){let n=s.heading,r=_b[t];return!n||typeof r!=`number`?!1:hb(i(n,{level:r}),e)}if(t===`blockquote`){let t=s.blockquote;return t?hb(a(t),e):!1}if(t===`taskList`){let t=s.bullet_list;return!t||!hb(o(t),e)?!1:gb(e,!1)}if(t===`codeBlock`){let t=s.code_block;return t?hb(i(t,{language:`text`}),e):!1}if(t in vb){let n=s[vb[t]];return n?hb(o(n),e):!1}return!1},xb=e=>{let t=e.state.selection.$from,n=new Set;for(let e=t.depth;e>0;--e){let r=t.node(e),i=r.type.name;if(i===`code_block`){n.add(`codeBlock`);continue}if(i===`blockquote`){n.add(`blockquote`);continue}if(i===`heading`){let e={1:`heading1`,2:`heading2`,3:`heading3`,4:`heading4`,5:`heading5`,6:`heading6`}[Number(r.attrs?.level??0)];e&&n.add(e);continue}if(i===`list_item`){typeof r.attrs?.checked==`boolean`&&n.add(`taskList`);continue}if(i===`ordered_list`){n.add(`orderedList`);continue}if(i===`bullet_list`){n.add(`bulletList`);continue}i===`paragraph`&&n.add(`paragraph`)}return n.has(`taskList`)&&n.delete(`bulletList`),n.size===0&&n.add(`paragraph`),n},Sb=e=>{let t=xb(e);return yb.find(e=>t.has(e))||`paragraph`},Cb=e=>typeof e.props.editable==`function`?e.props.editable(e.state):e.editable,wb=(e,t)=>{let n=e.state.schema.marks,r=t.find(e=>n[e]);return r?n[r]??null:null},Tb=(e,t)=>{let{from:n,to:r}=e.selection;return e.doc.rangeHasMark(n,r,t)},Eb=(e,t)=>{let{from:n,to:r}=e.selection,i=``;return e.doc.nodesBetween(n,r,e=>{let n=e.marks.find(e=>e.type===t);return n?(i=typeof n.attrs.href==`string`?n.attrs.href:``,!1):!0}),i},Db=e=>{n.O(e.markType)(e.view.state,e.view.dispatch,e.view),e.view.focus()},Ob=e=>{e.toggleLinkPopover(e.view)},kb=(e,t)=>{({strong:Db,em:Db,strike:Db,inlineCode:Db,link:Ob})[e](t)},Ab=(e,t,n,r,i)=>{let a=document.createElement(`button`);a.type=`button`,a.className=`zt-md-selection-tooltip-button`,a.dataset.command=e.command,a.title=e.title,a.setAttribute(`aria-label`,e.title);let o=document.createElement(`span`);o.className=`zt-md-selection-tooltip-button-icon`;let s=(0,f.createRoot)(o);return s.render((0,u.createElement)(e.icon,{size:14,strokeWidth:2})),i.push(s),a.append(o),a.addEventListener(`mousedown`,e=>{e.preventDefault()}),a.addEventListener(`click`,i=>{i.preventDefault();let a=n();!a||a.state.selection.empty||kb(e.command,{view:a,markType:t,toggleLinkPopover:r})}),a},jb=(e,t,n,r,i,a)=>{let o=document.createElement(`div`);return o.className=`zt-md-selection-tooltip`,o.append(i),t.forEach(t=>{let i=wb(e,t.markNames);i&&t.command!==`link`&&o.append(Ab(t,i,n,r,a))}),o},Mb=e=>{Dy(e.open,()=>{e.onOpenChange(!1)});let t=e=>{e.preventDefault()},n=t=>{let n=e.getCurrentView();if(!n||n.state.selection.empty){e.onOpenChange(!1);return}bb(n,t).then(()=>{e.onOpenChange(!1),n.focus()})};return(0,u.createElement)(_y,{open:e.open,onOpenChange:e.onOpenChange},(0,u.createElement)(vy,{asChild:!0},(0,u.createElement)(`button`,{type:`button`,className:`zt-md-selection-transform-trigger`,"aria-label":e.menuTitle,title:e.menuTitle,onMouseDown:t},(0,u.createElement)(`span`,{className:`zt-md-selection-transform-trigger-label`},e.activeLabel),(0,u.createElement)(Ce,{size:e.iconSize,strokeWidth:e.iconStrokeWidth,"aria-hidden":`true`}))),(0,u.createElement)(yy,{container:e.portalContainer,align:`start`,sideOffset:8,className:`zt-md-selection-transform-popover !w-[176px] p-1`,onOpenAutoFocus:e=>e.preventDefault(),onCloseAutoFocus:e=>e.preventDefault()},(0,u.createElement)(`p`,{className:`zt-md-selection-transform-popover-title`},e.menuTitle),(0,u.createElement)(`div`,{className:`zt-md-selection-transform-popover-list`},...e.items.map(r=>{let i=e.activeCommands.has(r.command);return(0,u.createElement)(`button`,{key:r.command,type:`button`,className:`zt-md-selection-transform-item`,"data-active":i?`true`:`false`,onMouseDown:t,onClick:()=>n(r.command)},(0,u.createElement)(r.icon,{size:e.iconSize,strokeWidth:e.iconStrokeWidth,className:`zt-md-selection-transform-item-icon`,"aria-hidden":`true`}),(0,u.createElement)(`span`,{className:`zt-md-selection-transform-item-label`},r.label))}))))},Nb=e=>{let[t,n]=(0,u.useState)(``),r=(0,u.useRef)(null);Dy(e.open,()=>{e.onOpenChange(!1)});let i=e=>{e.preventDefault()},a=t=>{let n=e.getCurrentView();if(!n||n.state.selection.empty){e.onOpenChange(!1);return}let r=wb(n,[`link`]);if(!r){e.onOpenChange(!1);return}let i=mn(t),{from:a,to:o}=n.state.selection,s=n.state.tr.removeMark(a,o,r);i&&s.addMark(a,o,r.create({href:i})),n.dispatch(s.scrollIntoView()),e.onOpenChange(!1),n.focus()};return(0,u.useEffect)(()=>{if(!e.open)return;let t=e.getCurrentView(),n=t?wb(t,[`link`]):null;(!t||!n||t.state.selection.empty)&&e.onOpenChange(!1)},[e.open,e.getCurrentView,e.onOpenChange]),(0,u.useEffect)(()=>{e.open&&r.current?.focus()},[e.open]),(0,u.createElement)(_y,{open:e.open,onOpenChange:t=>{if(!t){e.onOpenChange(!1);return}let r=e.getCurrentView(),i=r?wb(r,[`link`]):null;if(!r||!i||r.state.selection.empty){e.onOpenChange(!1);return}n(mn(Eb(r.state,i))),e.onOpenChange(!0)}},(0,u.createElement)(vy,{asChild:!0},(0,u.createElement)(`button`,{ref:e.triggerRef,type:`button`,className:`zt-md-selection-tooltip-button`,"data-command":`link`,title:e.messages.selectionTooltipLinkTitle,"aria-label":e.messages.selectionTooltipLinkTitle,onMouseDown:i},(0,u.createElement)(`span`,{className:`zt-md-selection-tooltip-button-icon`},(0,u.createElement)(Be,{size:e.iconSize,strokeWidth:e.iconStrokeWidth})))),(0,u.createElement)(yy,{container:e.portalContainer,align:`center`,sideOffset:8,className:`zt-md-selection-link-popover w-fit min-w-0 gap-0 p-2`,onOpenAutoFocus:e=>{e.preventDefault(),requestAnimationFrame(()=>{r.current?.focus()})},onCloseAutoFocus:e=>e.preventDefault()},(0,u.createElement)(`div`,{className:`zt-md-selection-link-popover-row`},(0,u.createElement)(`input`,{ref:r,type:`text`,value:t,placeholder:e.messages.selectionLinkInputPlaceholder,className:`zt-md-selection-link-popover-input`,onChange:e=>n(e.currentTarget.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),a(t.trim()))}}),(0,u.createElement)(ol,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`zt-md-selection-link-popover-action cursor-pointer bg-transparent hover:bg-transparent focus-visible:ring-0`,onMouseDown:i,onClick:()=>a(t.trim()),"aria-label":e.messages.selectionLinkSaveAriaLabel},(0,u.createElement)(Se,{size:e.iconSize,strokeWidth:e.iconStrokeWidth})),(0,u.createElement)(ol,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`zt-md-selection-link-popover-action cursor-pointer bg-transparent hover:bg-transparent focus-visible:ring-0`,onMouseDown:i,onClick:()=>a(``),"aria-label":e.messages.selectionLinkRemoveAriaLabel},(0,u.createElement)(nt,{size:e.iconSize,strokeWidth:e.iconStrokeWidth})))))},Pb=(e,t,n)=>{n.forEach(n=>{let r=wb(t,n.markNames);if(!r)return;let i=e.querySelector(`[data-command="${n.command}"]`);i instanceof HTMLButtonElement&&(i.dataset.active=Tb(t.state,r)?`true`:`false`)})},Fb=e=>{let{from:t,to:n}=e.state.selection,r=!1;return e.state.doc.nodesBetween(t,n,e=>e.type.name===`code_block`?(r=!0,!1):!0),r},Ib=(e,n,r)=>i=>{let{selection:a,doc:o}=i.state,s=e.contains(document.activeElement);return!Cb(i)||a.empty||!(a instanceof t.c)||!i.hasFocus()&&!s&&!n()&&!r()||Fb(i)?!1:e.childElementCount>0&&o.textBetween(a.from,a.to).trim().length>0},Lb=(e,t,n)=>{let r=fb(n),i=mb(n),a=e,o=!1,s=!1,c=[],l=document.createElement(`span`),d=(0,f.createRoot)(l),p=document.createElement(`span`),m=null,h=(0,f.createRoot)(p),g=e=>{o!==e&&(o=e,b())},_=e=>{s!==e&&(s=e,y())},v=e=>{e.state.selection.empty||g(!o)},y=()=>{let e=a?xb(a):new Set([`paragraph`]),r=a?Sb(a):`paragraph`,o=i.find(e=>e.command===r)??i[0];d.render((0,u.createElement)(Mb,{getCurrentView:()=>a,portalContainer:t,iconSize:14,iconStrokeWidth:2,menuTitle:n.selectionTooltipTransformLabel,items:i,activeLabel:o?.label??n.selectionTooltipTransformParagraphLabel,open:s,onOpenChange:_,activeCommands:e}))},b=()=>{h.render((0,u.createElement)(Nb,{getCurrentView:()=>a,portalContainer:t,iconSize:14,iconStrokeWidth:2,triggerRef:e=>{m=e},open:o,onOpenChange:g,messages:n}))},x=jb(e,r,()=>a,v,l,c);y(),wb(e,[`link`])&&(x.append(p),b());let S=new ub({content:x,debounce:80,offset:8,root:t,shouldShow:Ib(x,()=>o,()=>s),floatingUIOptions:{placement:`top`}});return{update:(e,t)=>{if(a=e,a.state.selection.empty&&(g(!1),_(!1)),Pb(x,a,r),y(),m){let e=wb(a,[`link`]);m.dataset.active=e&&Tb(a.state,e)?`true`:`false`}S.update(a,t)},destroy:()=>{a=null,d.unmount(),h.unmount(),c.splice(0).forEach(e=>{e.unmount()}),S.destroy(),x.remove()}}},Rb=(e,n)=>r.u(()=>new t.i({key:new t.a(db),view:t=>Lb(t,e,n)})),zb=(e,t)=>{if(!(!e||typeof e!=`object`))return e[t]},Bb=(e,t)=>e(t.state,t.dispatch,t),Vb=e=>{let t=e?.state?.selection?.$from;if(!t)return!1;for(let e=t.depth;e>0;--e)if(t.node(e)?.type?.name===`table`)return!0;return!1},Hb=(e,t)=>{let n=e?.state?.doc;if(!n||typeof t!=`number`)return-1;let r=Math.min(Math.max(t,0),n.content.size),i=n.resolve(r);for(let e=i.depth;e>0;--e)if(i.node(e)?.type?.name===`table`)return i.before(e);return-1},Ub=(e,t,n,r)=>{let i=e?.state?.schema?.nodes;if(!i)return null;let a=i.table,o=i.table_header_row,s=i.table_row,c=i.table_header,l=i.table_cell;if(!a||!o||!s||!c||!l)return null;let u=Math.max(1,t),d=Math.max(1,n),f=Array.from({length:u},(e,t)=>{let n=r&&t===0,i=n?o:s,a=n?c:l,u=Array.from({length:d},()=>a.createAndFill()).filter(Boolean);return i.create(null,u)});return a.create(null,f)},Wb=async e=>{if(!e?.state||!e?.dispatch||Vb(e))return!1;let t=e.state.selection.from,n=Ub(e,3,3,!0);if(!n)return!1;e.dispatch(e.state.tr.replaceSelectionWith(n).scrollIntoView());let r=Hb(e,t);if(r<0&&t>0&&(r=Hb(e,t-1)),r<0)return!0;let i=r+2;if(i>e.state.doc.content.size)return!0;let a=zb(await Promise.resolve().then(()=>require("./state-BC1dqWPQ.cjs")),`TextSelection`);if(!a||typeof a.near!=`function`)return!0;let o=a.near(e.state.doc.resolve(i),1);return e.dispatch(e.state.tr.setSelection(o).scrollIntoView()),e.focus(),!0},Gb=(e,t)=>{let n=e?.state?.schema?.marks??{},r=t.find(e=>n[e]);return r?n[r]??null:null},Kb=new Set([`paragraph`,`heading1`,`heading2`,`heading3`,`heading4`,`heading5`,`heading6`,`bulletList`,`orderedList`,`taskList`,`blockquote`,`codeBlock`]),qb=e=>Kb.has(e),Jb=async e=>{let t=e?.state?.schema?.nodes?.math_inline;if(!t||!e?.dispatch)return!1;let n=e.state.selection.from,r=t.create({value:``});return e.dispatch(e.state.tr.replaceSelectionWith(r).setMeta(eg,{type:`open`,position:n}).scrollIntoView()),!0},Yb=async(e,t)=>{if(!e?.state||!e?.dispatch)return!1;let n=await Promise.resolve().then(()=>require("./commands-f4yOm8DQ.cjs")),r=zb(n,`setBlockType`),i=zb(n,`toggleMark`);if(typeof r!=`function`||typeof i!=`function`)return!1;let a=e.state.schema?.nodes??{};if(qb(t))return bb(e,t);if(t===`inlineCode`){let t=Gb(e,[`inlineCode`,`code_inline`]);return t?Bb(i(t),e):!1}if(t===`inlineMath`)return Jb(e);if(t===`mathBlock`){let t=a.math_block;if(!t||!Bb(r(t),e))return!1;let n=zb(await Promise.resolve().then(()=>require("./state-BC1dqWPQ.cjs")),`NodeSelection`);if(!n||typeof n.create!=`function`)return!0;let i=e.state.selection?.$from;if(!i)return!0;let o=null;for(let e=i.depth;e>0;--e)if(i.node(e)?.type?.name===`math_block`){o=i.before(e);break}if(o===null)return!0;let s=n.create(e.state.doc,o);return e.dispatch(e.state.tr.setSelection(s).scrollIntoView()),!0}return t===`table`?Wb(e):!1},Xb=e=>typeof e?.props?.editable==`function`?e.props.editable(e.state):!!e?.editable,Zb=[{id:`paragraph`,label:`普通文本`,group:`标题`,icon:`Type`,command:`paragraph`},{id:`heading-1`,label:`标题 1`,group:`标题`,icon:`Heading1`,command:`heading1`},{id:`heading-2`,label:`标题 2`,group:`标题`,icon:`Heading2`,command:`heading2`},{id:`heading-3`,label:`标题 3`,group:`标题`,icon:`Heading3`,command:`heading3`},{id:`heading-4`,label:`标题 4`,group:`标题`,icon:`Heading4`,command:`heading4`},{id:`heading-5`,label:`标题 5`,group:`标题`,icon:`Heading5`,command:`heading5`},{id:`heading-6`,label:`标题 6`,group:`标题`,icon:`Heading6`,command:`heading6`},{id:`bullet-list`,label:`无序列表`,group:`列表`,icon:`List`,command:`bulletList`},{id:`ordered-list`,label:`有序列表`,group:`列表`,icon:`ListOrdered`,command:`orderedList`},{id:`task-list`,label:`任务列表`,group:`列表`,icon:`ListTodo`,command:`taskList`},{id:`blockquote`,label:`引用块`,group:`插入`,icon:`TextQuote`,command:`blockquote`},{id:`inline-code`,label:`行内代码`,group:`插入`,icon:`Code`,command:`inlineCode`},{id:`code-block`,label:`代码块`,group:`插入`,icon:`SquareCode`,command:`codeBlock`},{id:`table`,label:`表格`,group:`插入`,icon:`Table`,command:`table`},{id:`inline-math`,label:`行内公式`,group:`公式`,icon:`Sigma`,command:`inlineMath`},{id:`math-block`,label:`公式块`,group:`公式`,icon:`SquareFunction`,command:`mathBlock`},{id:`image`,label:`图片`,group:`媒体`,icon:`Image`,command:`image`}],Qb=[{id:`paragraph`,label:`Paragraph`,group:`Headings`,icon:`Type`,command:`paragraph`},{id:`heading-1`,label:`Heading 1`,group:`Headings`,icon:`Heading1`,command:`heading1`},{id:`heading-2`,label:`Heading 2`,group:`Headings`,icon:`Heading2`,command:`heading2`},{id:`heading-3`,label:`Heading 3`,group:`Headings`,icon:`Heading3`,command:`heading3`},{id:`heading-4`,label:`Heading 4`,group:`Headings`,icon:`Heading4`,command:`heading4`},{id:`heading-5`,label:`Heading 5`,group:`Headings`,icon:`Heading5`,command:`heading5`},{id:`heading-6`,label:`Heading 6`,group:`Headings`,icon:`Heading6`,command:`heading6`},{id:`bullet-list`,label:`Bullet list`,group:`Lists`,icon:`List`,command:`bulletList`},{id:`ordered-list`,label:`Ordered list`,group:`Lists`,icon:`ListOrdered`,command:`orderedList`},{id:`task-list`,label:`Task list`,group:`Lists`,icon:`ListTodo`,command:`taskList`},{id:`blockquote`,label:`Blockquote`,group:`Insert`,icon:`TextQuote`,command:`blockquote`},{id:`inline-code`,label:`Inline code`,group:`Insert`,icon:`Code`,command:`inlineCode`},{id:`code-block`,label:`Code block`,group:`Insert`,icon:`SquareCode`,command:`codeBlock`},{id:`table`,label:`Table`,group:`Insert`,icon:`Table`,command:`table`},{id:`inline-math`,label:`Inline math`,group:`Math`,icon:`Sigma`,command:`inlineMath`},{id:`math-block`,label:`Math block`,group:`Math`,icon:`SquareFunction`,command:`mathBlock`},{id:`image`,label:`Image`,group:`Media`,icon:`Image`,command:`image`}],$b=(e,t=`zh-CN`)=>e?.items&&e.items.length>0?e.items:t===`en-US`?Qb:Zb,ex=e=>{let t=e?.state?.selection?.$from;if(!t)return!1;let n=String(t.parent?.type?.name??``);if(n.includes(`code`)||n===`math_block`)return!0;for(let e=t.depth;e>0;--e){let n=String(t.node(e)?.type?.name??``);if(n===`table`||n===`table_cell`||n===`table_header`)return!0}return!1},tx=e=>{let t=e?.state,n=t?.selection?.$from;if(!t||!n)return``;let r=n.start(),i=n.pos;return t.doc.textBetween(r,i,`
|
|
361
|
+
|(?![\\s\\S])))+`,`m`),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}}),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})})(e)}bG.displayName=`go`,bG.aliases=[];function bG(e){e.register(dG),e.languages.go=e.languages.extend(`clike`,{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),e.languages.insertBefore(`go`,`string`,{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete e.languages.go[`class-name`]}xG.displayName=`ini`,xG.aliases=[];function xG(e){e.languages.ini={comment:{pattern:/(^[ \f\t\v]*)[#;][^\n\r]*/m,lookbehind:!0},section:{pattern:/(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m,lookbehind:!0,inside:{"section-name":{pattern:/(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/,lookbehind:!0,alias:`selector`},punctuation:/\[|\]/}},key:{pattern:/(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m,lookbehind:!0,alias:`attr-name`},value:{pattern:/(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/,lookbehind:!0,alias:`attr-value`,inside:{"inner-value":{pattern:/^("|').+(?=\1$)/,lookbehind:!0}}},punctuation:/=/}}SG.displayName=`java`,SG.aliases=[];function SG(e){e.register(dG),(function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=`(?:[a-z]\\w*\\s*\\.\\s*)*(?:[A-Z]\\w*\\s*\\.\\s*)*`,r={pattern:RegExp(`(^|[^\\w.])`+n+`[A-Z](?:[\\d_A-Z]*[a-z]\\w*)?\\b`),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend(`clike`,{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(`(^|[^\\w.])`+n+`[A-Z]\\w*(?=\\s+\\w+\\s*[;,=()]|\\s*(?:\\[[\\s,]*\\]\\s*)?::\\s*new\\b)`),lookbehind:!0,inside:r.inside},{pattern:RegExp(`(\\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\\s+)`+n+`[A-Z]\\w*\\b`),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore(`java`,`string`,{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:`string`},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore(`java`,`class-name`,{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:`punctuation`},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(`(\\bimport\\s+)`+n+`(?:[A-Z]\\w*|\\*)(?=\\s*;)`),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(`(\\bimport\\s+static\\s+)`+n+`(?:\\w+|\\*)(?=\\s*;)`),lookbehind:!0,alias:`static`,inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(`(\\b(?:exports|import(?:\\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\\s+)(?!<keyword>)[a-z]\\w*(?:\\.[a-z]\\w*)*\\.?`.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}CG.displayName=`regex`,CG.aliases=[];function CG(e){(function(e){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:`escape`},n=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,r={pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:`class-name`},i={pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:`class-name`},a=`(?:[^\\\\-]|`+n.source+`)`,o=RegExp(a+`-`+a),s={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:`variable`};e.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:`operator`},"char-class-punctuation":{pattern:/^\[|\]$/,alias:`punctuation`},range:{pattern:o,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:`operator`}}},"special-escape":t,"char-set":i,escape:n}},"special-escape":t,"char-set":r,backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:`keyword`},{pattern:/\\k<[^<>']+>/,alias:`keyword`,inside:{"group-name":s}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:`function`},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:`punctuation`,inside:{"group-name":s}},{pattern:/\)/,alias:`punctuation`}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:`number`},alternation:{pattern:/\|/,alias:`keyword`}}})(e)}wG.displayName=`javascript`,wG.aliases=[`js`];function wG(e){e.register(dG),e.languages.javascript=e.languages.extend(`clike`,{"class-name":[e.languages.clike[`class-name`],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(`(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])`),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript[`class-name`][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore(`javascript`,`keyword`,{regex:{pattern:RegExp(`((?:^|[^$\\w\\xA0-\\uFFFF."'\\])\\s]|\\b(?:return|yield))\\s*)\\/(?:(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))`),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:`language-regex`,inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:`function`},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore(`javascript`,`string`,{hashbang:{pattern:/^#!.*/,greedy:!0,alias:`comment`},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:`string`},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:`punctuation`},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:`property`}}),e.languages.insertBefore(`javascript`,`operator`,{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:`property`}}),e.languages.markup&&(e.languages.markup.tag.addInlined(`script`,`javascript`),e.languages.markup.tag.addAttribute(`on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)`,`javascript`)),e.languages.js=e.languages.javascript}TG.displayName=`json`,TG.aliases=[`webmanifest`];function TG(e){e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:`keyword`}},e.languages.webmanifest=e.languages.json}EG.displayName=`kotlin`,EG.aliases=[`kt`,`kts`];function EG(e){e.register(dG),(function(e){e.languages.kotlin=e.languages.extend(`clike`,{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete e.languages.kotlin[`class-name`];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:`punctuation`},expression:{pattern:/[\s\S]+/,inside:e.languages.kotlin}};e.languages.insertBefore(`kotlin`,`string`,{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:`multiline`,inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:`singleline`,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete e.languages.kotlin.string,e.languages.insertBefore(`kotlin`,`keyword`,{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:`builtin`}}),e.languages.insertBefore(`kotlin`,`function`,{label:{pattern:/\b\w+@|@\w+\b/,alias:`symbol`}}),e.languages.kt=e.languages.kotlin,e.languages.kts=e.languages.kotlin})(e)}DG.displayName=`less`,DG.aliases=[];function DG(e){e.register(vG),e.languages.less=e.languages.extend(`css`,{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),e.languages.insertBefore(`less`,`property`,{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:`function`}})}OG.displayName=`lua`,OG.aliases=[];function OG(e){e.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/}}kG.displayName=`makefile`,kG.aliases=[];function kG(e){e.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:`builtin`},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:`symbol`,inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/}}AG.displayName=`yaml`,AG.aliases=[`yml`];function AG(e){(function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r=`(?:`+n.source+`(?:[ ]+`+t.source+`)?|`+t.source+`(?:[ ]+`+n.source+`)?)`,i=`(?:[^\\s\\x00-\\x08\\x0e-\\x1f!"#%&'*,\\-:>?@[\\]\`{|}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]|[?:-]<PLAIN>)(?:[ \\t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*`.replace(/<PLAIN>/g,function(){return`[^\\s\\x00-\\x08\\x0e-\\x1f,[\\]{}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]`}),a=`"(?:[^"\\\\\\r\\n]|\\\\.)*"|'(?:[^'\\\\\\r\\n]|\\\\.)*'`;function o(e,t){t=(t||``).replace(/m/g,``)+`m`;var n=`([:\\-,[{]\\s*(?:\\s<<prop>>[ \\t]+)?)(?:<<value>>)(?=[ \\t]*(?:$|,|\\]|\\}|(?:[\\r\\n]\\s*)?#))`.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return e});return RegExp(n,t)}e.languages.yaml={scalar:{pattern:RegExp(`([\\-:]\\s*(?:\\s<<prop>>[ \\t]+)?[|>])[ \\t]*(?:((?:\\r?\\n|\\r)[ \\t]+)\\S[^\\r\\n]*(?:\\2[^\\r\\n]+)*)`.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:`string`},comment:/#.*/,key:{pattern:RegExp(`((?:^|[:\\-,[{\\r\\n?])[ \\t]*(?:<<prop>>[ \\t]+)?)<<key>>(?=\\s*:\\s)`.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return`(?:`+i+`|`+a+`)`})),lookbehind:!0,greedy:!0,alias:`atrule`},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:`important`},datetime:{pattern:o(`\\d{4}-\\d\\d?-\\d\\d?(?:[tT]|[ \\t]+)\\d\\d?:\\d{2}:\\d{2}(?:\\.\\d*)?(?:[ \\t]*(?:Z|[-+]\\d\\d?(?::\\d{2})?))?|\\d{4}-\\d{2}-\\d{2}|\\d\\d?:\\d{2}(?::\\d{2}(?:\\.\\d*)?)?`),lookbehind:!0,alias:`number`},boolean:{pattern:o(`false|true`,`i`),lookbehind:!0,alias:`important`},null:{pattern:o(`null|~`,`i`),lookbehind:!0,alias:`important`},string:{pattern:o(a),lookbehind:!0,greedy:!0},number:{pattern:o(`[+-]?(?:0x[\\da-f]+|0o[0-7]+|(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?|\\.inf|\\.nan)`,`i`),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml})(e)}jG.displayName=`markdown`,jG.aliases=[`md`];function jG(e){e.register(_G),(function(e){var t=`(?:\\\\.|[^\\\\\\n\\r]|(?:\\n|\\r\\n?)(?![\\r\\n]))`;function n(e){return e=e.replace(/<inner>/g,function(){return t}),RegExp(`((?:^|[^\\\\])(?:\\\\{2})*)(?:`+e+`)`)}var r="(?:\\\\.|``(?:[^`\\r\\n]|`(?!`))+``|`[^`\\r\\n]+`|[^\\\\|\\r\\n`])+",i=`\\|?__(?:\\|__)+\\|?(?:(?:\\n|\\r\\n?)|(?![\\s\\S]))`.replace(/__/g,function(){return r}),a=`\\|?[ \\t]*:?-{3,}:?[ \\t]*(?:\\|[ \\t]*:?-{3,}:?[ \\t]*)+\\|?(?:\\n|\\r\\n?)`;e.languages.markdown=e.languages.extend(`markup`,{}),e.languages.insertBefore(`markdown`,`prolog`,{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:[`yaml`,`language-yaml`],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:`punctuation`},table:{pattern:RegExp(`^`+i+a+`(?:`+i+`)*`,`m`),inside:{"table-data-rows":{pattern:RegExp(`^(`+i+a+`)(?:`+i+`)*$`),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp(`^(`+i+`)`+a+`$`),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp(`^`+i+`$`),inside:{"table-header":{pattern:RegExp(r),alias:`important`,inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:`keyword`},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:`important`,inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:`important`,inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:`punctuation`},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:`punctuation`},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:`url`},bold:{pattern:n(`\\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\\b|\\*\\*(?:(?!\\*)<inner>|\\*(?:(?!\\*)<inner>)+\\*)+\\*\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(`\\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\\b|\\*(?:(?!\\*)<inner>|\\*\\*(?:(?!\\*)<inner>)+\\*\\*)+\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(`(~~?)(?:(?!~)<inner>)+\\2`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:[`code`,`keyword`]},url:{pattern:n(`!?\\[(?:(?!\\])<inner>)+\\](?:\\([^\\s)]+(?:[\\t ]+"(?:\\\\.|[^"\\\\])*")?\\)|[ \\t]?\\[(?:(?!\\])<inner>)+\\])`),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),[`url`,`bold`,`italic`,`strike`].forEach(function(t){[`url`,`bold`,`italic`,`strike`,`code-snippet`].forEach(function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])})}),e.hooks.add(`after-tokenize`,function(e){if(e.language!==`markdown`&&e.language!==`md`)return;function t(e){if(!(!e||typeof e==`string`))for(var n=0,r=e.length;n<r;n++){var i=e[n];if(i.type!==`code`){t(i.content);continue}var a=i.content[1],o=i.content[3];if(a&&o&&a.type===`code-language`&&o.type===`code-block`&&typeof a.content==`string`){var s=a.content.replace(/\b#/g,`sharp`).replace(/\b\+\+/g,`pp`);s=(/[a-z][\w-]*/i.exec(s)||[``])[0].toLowerCase();var c=`language-`+s;o.alias?typeof o.alias==`string`?o.alias=[o.alias,c]:o.alias.push(c):o.alias=[c]}}}t(e.tokens)}),e.hooks.add(`wrap`,function(t){if(t.type===`code-block`){for(var n=``,r=0,i=t.classes.length;r<i;r++){var a=t.classes[r],o=/language-(.+)/.exec(a);if(o){n=o[1];break}}var s=e.languages[n];if(s)t.content=e.highlight(t.content.value,s,n);else if(n&&n!==`none`&&e.plugins.autoloader){var c=`md-`+new Date().valueOf()+`-`+Math.floor(Math.random()*0x2386f26fc10000);t.attributes.id=c,e.plugins.autoloader.loadLanguages(n,function(){var t=document.getElementById(c);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))})}}}),RegExp(e.languages.markup.tag.pattern.source,`gi`),String.fromCodePoint||String.fromCharCode,e.languages.md=e.languages.markdown})(e)}MG.displayName=`objectivec`,MG.aliases=[`objc`];function MG(e){e.register(fG),e.languages.objectivec=e.languages.extend(`c`,{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec[`class-name`],e.languages.objc=e.languages.objectivec}NG.displayName=`perl`,NG.aliases=[];function NG(e){(function(e){var t=`(?:\\((?:[^()\\\\]|\\\\[\\s\\S])*\\)|\\{(?:[^{}\\\\]|\\\\[\\s\\S])*\\}|\\[(?:[^[\\]\\\\]|\\\\[\\s\\S])*\\]|<(?:[^<>\\\\]|\\\\[\\s\\S])*>)`;e.languages.perl={comment:[{pattern:/(^\s*)=\w[\s\S]*?=cut.*/m,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0,greedy:!0}],string:[{pattern:RegExp(`\\b(?:q|qq|qw|qx)(?![a-zA-Z0-9])\\s*(?:`+[`([^a-zA-Z0-9\\s{(\\[<])(?:(?!\\1)[^\\\\]|\\\\[\\s\\S])*\\1`,`([a-zA-Z0-9])(?:(?!\\2)[^\\\\]|\\\\[\\s\\S])*\\2`,t].join(`|`)+`)`),greedy:!0},{pattern:/("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/'(?:[^'\\\r\n]|\\.)*'/,greedy:!0}],regex:[{pattern:RegExp(`\\b(?:m|qr)(?![a-zA-Z0-9])\\s*(?:`+[`([^a-zA-Z0-9\\s{(\\[<])(?:(?!\\1)[^\\\\]|\\\\[\\s\\S])*\\1`,`([a-zA-Z0-9])(?:(?!\\2)[^\\\\]|\\\\[\\s\\S])*\\2`,t].join(`|`)+`)[msixpodualngc]*`),greedy:!0},{pattern:RegExp(`(^|[^-])\\b(?:s|tr|y)(?![a-zA-Z0-9])\\s*(?:`+[`([^a-zA-Z0-9\\s{(\\[<])(?:(?!\\2)[^\\\\]|\\\\[\\s\\S])*\\2(?:(?!\\2)[^\\\\]|\\\\[\\s\\S])*\\2`,`([a-zA-Z0-9])(?:(?!\\3)[^\\\\]|\\\\[\\s\\S])*\\3(?:(?!\\3)[^\\\\]|\\\\[\\s\\S])*\\3`,t+`\\s*`+t].join(`|`)+`)[msixpodualngcer]*`),lookbehind:!0,greedy:!0},{pattern:/\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|x|xor)\b))/,greedy:!0}],variable:[/[&*$@%]\{\^[A-Z]+\}/,/[&*$@%]\^[A-Z_]/,/[&*$@%]#?(?=\{)/,/[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/,/[&*$@%]\d+/,/(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],filehandle:{pattern:/<(?![<=])\S*?>|\b_\b/,alias:`symbol`},"v-string":{pattern:/v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,alias:`string`},function:{pattern:/(\bsub[ \t]+)\w+/,lookbehind:!0},keyword:/\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/,punctuation:/[{}[\];(),:]/}})(e)}PG.displayName=`markup-templating`,PG.aliases=[];function PG(e){e.register(_G),(function(e){function t(e,t){return`___`+e.toUpperCase()+t+`___`}Object.defineProperties(e.languages[`markup-templating`]={},{buildPlaceholders:{value:function(n,r,i,a){if(n.language===r){var o=n.tokenStack=[];n.code=n.code.replace(i,function(e){if(typeof a==`function`&&!a(e))return e;for(var i=o.length,s;n.code.indexOf(s=t(r,i))!==-1;)++i;return o[i]=e,s}),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,r){if(n.language!==r||!n.tokenStack)return;n.grammar=e.languages[r];var i=0,a=Object.keys(n.tokenStack);function o(s){for(var c=0;c<s.length&&!(i>=a.length);c++){var l=s[c];if(typeof l==`string`||l.content&&typeof l.content==`string`){var u=a[i],d=n.tokenStack[u],f=typeof l==`string`?l:l.content,p=t(r,u),m=f.indexOf(p);if(m>-1){++i;var h=f.substring(0,m),g=new e.Token(r,e.tokenize(d,n.grammar),`language-`+r,d),_=f.substring(m+p.length),v=[];h&&v.push.apply(v,o([h])),v.push(g),_&&v.push.apply(v,o([_])),typeof l==`string`?s.splice.apply(s,[c,1].concat(v)):l.content=v}}else l.content&&o(l.content)}return s}o(n.tokens)}}})})(e)}FG.displayName=`php`,FG.aliases=[];function FG(e){e.register(PG),(function(e){var t=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,n=[{pattern:/\b(?:false|true)\b/i,alias:`boolean`},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],r=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,i=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,a=/[{}\[\](),:;]/;e.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:`important`},comment:t,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:`class-name`},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:`function`},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:`type-casting`,greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:`type-hint`,greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:`return-type`,greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:`type-declaration`,greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:`type-declaration`,greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:`static-context`,greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:`class-name-fully-qualified`,greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:`class-name-fully-qualified`,greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:`class-name-fully-qualified`,greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:`type-declaration`,greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:[`class-name-fully-qualified`,`type-declaration`],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:`static-context`,greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:[`class-name-fully-qualified`,`static-context`],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:`type-hint`,greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:[`class-name-fully-qualified`,`type-hint`],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:`return-type`,greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:[`class-name-fully-qualified`,`return-type`],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:r,operator:i,punctuation:a};var o={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:e.languages.php},s=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:`nowdoc-string`,greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:`symbol`,inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:`heredoc-string`,greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:`symbol`,inside:{punctuation:/^<<<"?|[";]$/}},interpolation:o}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:`backtick-quoted-string`,greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:`single-quoted-string`,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:`double-quoted-string`,greedy:!0,inside:{interpolation:o}}];e.languages.insertBefore(`php`,`variable`,{string:s,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:t,string:s,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:`class-name`,greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:[`class-name`,`class-name-fully-qualified`],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,number:r,operator:i,punctuation:a}},delimiter:{pattern:/^#\[|\]$/,alias:`punctuation`}}}}),e.hooks.add(`before-tokenize`,function(t){/<\?/.test(t.code)&&e.languages[`markup-templating`].buildPlaceholders(t,`php`,/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g)}),e.hooks.add(`after-tokenize`,function(t){e.languages[`markup-templating`].tokenizePlaceholders(t,`php`)})})(e)}IG.displayName=`python`,IG.aliases=[`py`];function IG(e){e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:`punctuation`},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:`string`},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:[`annotation`,`punctuation`],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python[`string-interpolation`].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}LG.displayName=`r`,LG.aliases=[];function LG(e){e.languages.r={comment:/#.*/,string:{pattern:/(['"])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"percent-operator":{pattern:/%[^%\s]*%/,alias:`operator`},boolean:/\b(?:FALSE|TRUE)\b/,ellipsis:/\.\.(?:\.|\d+)/,number:[/\b(?:Inf|NaN)\b/,/(?:\b0x[\dA-Fa-f]+(?:\.\d*)?|\b\d+(?:\.\d*)?|\B\.\d+)(?:[EePp][+-]?\d+)?[iL]?/],keyword:/\b(?:NA|NA_character_|NA_complex_|NA_integer_|NA_real_|NULL|break|else|for|function|if|in|next|repeat|while)\b/,operator:/->?>?|<(?:=|<?-)?|[>=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/,punctuation:/[(){}\[\],;]/}}RG.displayName=`ruby`,RG.aliases=[`rb`];function RG(e){e.register(dG),(function(e){e.languages.ruby=e.languages.extend(`clike`,{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),e.languages.insertBefore(`ruby`,`operator`,{"double-colon":{pattern:/::/,alias:`punctuation`}});var t={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:e.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:`punctuation`}}};delete e.languages.ruby.function;var n=`(?:`+[`([^a-zA-Z0-9\\s{(\\[<=])(?:(?!\\1)[^\\\\]|\\\\[\\s\\S])*\\1`,`\\((?:[^()\\\\]|\\\\[\\s\\S]|\\((?:[^()\\\\]|\\\\[\\s\\S])*\\))*\\)`,`\\{(?:[^{}\\\\]|\\\\[\\s\\S]|\\{(?:[^{}\\\\]|\\\\[\\s\\S])*\\})*\\}`,`\\[(?:[^\\[\\]\\\\]|\\\\[\\s\\S]|\\[(?:[^\\[\\]\\\\]|\\\\[\\s\\S])*\\])*\\]`,`<(?:[^<>\\\\]|\\\\[\\s\\S]|<(?:[^<>\\\\]|\\\\[\\s\\S])*>)*>`].join(`|`)+`)`,r=`(?:"(?:\\\\.|[^"\\\\\\r\\n])*"|(?:\\b[a-zA-Z_]\\w*|[^\\s\\0-\\x7F]+)[?!]?|\\$.)`;e.languages.insertBefore(`ruby`,`keyword`,{"regex-literal":[{pattern:RegExp(`%r`+n+`[egimnosux]{0,6}`),greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(`(^|[^:]):`+r),lookbehind:!0,greedy:!0},{pattern:RegExp(`([\\r\\n{(,][ \\t]*)`+r+`(?=:(?!:))`),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),e.languages.insertBefore(`ruby`,`string`,{"string-literal":[{pattern:RegExp(`%[qQiIwWs]?`+n),greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:`heredoc-string`,greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:`heredoc-string`,greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(`%x`+n),greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:`string`}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:`string`}}}]}),delete e.languages.ruby.string,e.languages.insertBefore(`ruby`,`number`,{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),e.languages.rb=e.languages.ruby})(e)}zG.displayName=`rust`,zG.aliases=[];function zG(e){(function(e){for(var t=`\\/\\*(?:[^*/]|\\*(?!\\/)|\\/(?!\\*)|<self>)*\\*\\/`,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return`[^\\s\\S]`}),e.languages.rust={comment:[{pattern:RegExp(`(^|[^\\\\])`+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:`attr-name`,inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:`punctuation`},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:`symbol`},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:`punctuation`},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:`function`},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:`class-name`},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:`namespace`},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:`namespace`,inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:`property`},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust[`closure-params`].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string})(e)}BG.displayName=`sass`,BG.aliases=[];function BG(e){e.register(vG),(function(e){e.languages.sass=e.languages.extend(`css`,{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),e.languages.insertBefore(`sass`,`atrule`,{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete e.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,n=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];e.languages.insertBefore(`sass`,`property`,{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:t,operator:n}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:t,operator:n,important:e.languages.sass.important}}}),delete e.languages.sass.property,delete e.languages.sass.important,e.languages.insertBefore(`sass`,`punctuation`,{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})})(e)}VG.displayName=`scss`,VG.aliases=[];function VG(e){e.register(vG),e.languages.scss=e.languages.extend(`css`,{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:`important`},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),e.languages.insertBefore(`scss`,`atrule`,{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),e.languages.insertBefore(`scss`,`important`,{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),e.languages.insertBefore(`scss`,`function`,{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:`keyword`},placeholder:{pattern:/%[-\w]+/,alias:`selector`},statement:{pattern:/\B!(?:default|optional)\b/i,alias:`keyword`},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:`keyword`},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),e.languages.scss.atrule.inside.rest=e.languages.scss}HG.displayName=`sql`,HG.aliases=[];function HG(e){e.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}}UG.displayName=`swift`,UG.aliases=[];function UG(e){e.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(`(^|[^"#])(?:"(?:\\\\(?:\\((?:[^()]|\\([^()]*\\))*\\)|\\r\\n|[^(])|[^\\\\\\r\\n"])*"|"""(?:\\\\(?:\\((?:[^()]|\\([^()]*\\))*\\)|[^(])|[^\\\\"]|"(?!""))*""")(?!["#])`),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:`punctuation`},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(`(^|[^"#])(#+)(?:"(?:\\\\(?:#+\\((?:[^()]|\\([^()]*\\))*\\)|\\r\\n|[^#])|[^\\\\\\r\\n])*?"|"""(?:\\\\(?:#+\\((?:[^()]|\\([^()]*\\))*\\)|[^#])|[^\\\\])*?""")\\2`),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:`punctuation`},string:/[\s\S]+/}}],directive:{pattern:RegExp(`#(?:(?:elseif|if)\\b(?:[ ]*(?:![ \\t]*)?(?:\\b\\w+\\b(?:[ \\t]*\\((?:[^()]|\\([^()]*\\))*\\))?|\\((?:[^()]|\\([^()]*\\))*\\))(?:[ \\t]*(?:&&|\\|\\|))?)+|(?:else|endif)\\b)`),alias:`property`,inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:`constant`},"other-directive":{pattern:/#\w+\b/,alias:`property`},attribute:{pattern:/@\w+/,alias:`atrule`},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:`function`},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:`important`},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:`constant`},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:`keyword`},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},e.languages.swift[`string-literal`].forEach(function(t){t.inside.interpolation.inside=e.languages.swift})}WG.displayName=`typescript`,WG.aliases=[`ts`];function WG(e){e.register(wG),(function(e){e.languages.typescript=e.languages.extend(`javascript`,{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript[`literal-property`];var t=e.languages.extend(`typescript`,{});delete t[`class-name`],e.languages.typescript[`class-name`].inside=t,e.languages.insertBefore(`typescript`,`function`,{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:`operator`},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:t}}}}),e.languages.ts=e.languages.typescript})(e)}GG.displayName=`basic`,GG.aliases=[];function GG(e){e.languages.basic={comment:{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},string:{pattern:/"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SELECT CASE|SHARED|SHELL|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i,function:/\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i,operator:/<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i,punctuation:/[,;:()]/}}KG.displayName=`vbnet`,KG.aliases=[];function KG(e){e.register(GG),e.languages.vbnet=e.languages.extend(`basic`,{comment:[{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},{pattern:/(^|[^\\:])'.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(^|[^"])"(?:""|[^"])*"(?!")/,lookbehind:!0,greedy:!0},keyword:/(?:\b(?:ADDHANDLER|ADDRESSOF|ALIAS|AND|ANDALSO|AS|BEEP|BLOAD|BOOLEAN|BSAVE|BYREF|BYTE|BYVAL|CALL(?: ABSOLUTE)?|CASE|CATCH|CBOOL|CBYTE|CCHAR|CDATE|CDBL|CDEC|CHAIN|CHAR|CHDIR|CINT|CLASS|CLEAR|CLNG|CLOSE|CLS|COBJ|COM|COMMON|CONST|CONTINUE|CSBYTE|CSHORT|CSNG|CSTR|CTYPE|CUINT|CULNG|CUSHORT|DATA|DATE|DECIMAL|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DEFAULT|DELEGATE|DIM|DIRECTCAST|DO|DOUBLE|ELSE|ELSEIF|END|ENUM|ENVIRON|ERASE|ERROR|EVENT|EXIT|FALSE|FIELD|FILES|FINALLY|FOR(?: EACH)?|FRIEND|FUNCTION|GET|GETTYPE|GETXMLNAMESPACE|GLOBAL|GOSUB|GOTO|HANDLES|IF|IMPLEMENTS|IMPORTS|IN|INHERITS|INPUT|INTEGER|INTERFACE|IOCTL|IS|ISNOT|KEY|KILL|LET|LIB|LIKE|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|ME|MKDIR|MOD|MODULE|MUSTINHERIT|MUSTOVERRIDE|MYBASE|MYCLASS|NAME|NAMESPACE|NARROWING|NEW|NEXT|NOT|NOTHING|NOTINHERITABLE|NOTOVERRIDABLE|OBJECT|OF|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPERATOR|OPTION(?: BASE)?|OPTIONAL|OR|ORELSE|OUT|OVERLOADS|OVERRIDABLE|OVERRIDES|PARAMARRAY|PARTIAL|POKE|PRIVATE|PROPERTY|PROTECTED|PUBLIC|PUT|RAISEEVENT|READ|READONLY|REDIM|REM|REMOVEHANDLER|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SBYTE|SELECT(?: CASE)?|SET|SHADOWS|SHARED|SHELL|SHORT|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|STRUCTURE|SUB|SWAP|SYNCLOCK|SYSTEM|THEN|THROW|TIMER|TO|TROFF|TRON|TRUE|TRY|TRYCAST|TYPE|TYPEOF|UINTEGER|ULONG|UNLOCK|UNTIL|USHORT|USING|VIEW PRINT|WAIT|WEND|WHEN|WHILE|WIDENING|WITH|WITHEVENTS|WRITE|WRITEONLY|XOR)|\B(?:#CONST|#ELSE|#ELSEIF|#END|#IF))(?:\$|\b)/i,punctuation:/[,;:(){}]/})}var qG=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};qG.prototype.normal={},qG.prototype.property={},qG.prototype.space=void 0;function JG(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new qG(n,r,t)}function YG(e){return e.toLowerCase()}var XG=class{constructor(e,t){this.attribute=t,this.property=e}};XG.prototype.attribute=``,XG.prototype.booleanish=!1,XG.prototype.boolean=!1,XG.prototype.commaOrSpaceSeparated=!1,XG.prototype.commaSeparated=!1,XG.prototype.defined=!1,XG.prototype.mustUseProperty=!1,XG.prototype.number=!1,XG.prototype.overloadedBoolean=!1,XG.prototype.property=``,XG.prototype.spaceSeparated=!1,XG.prototype.space=void 0;var ZG=s({boolean:()=>$G,booleanish:()=>eK,commaOrSpaceSeparated:()=>iK,commaSeparated:()=>rK,number:()=>Q,overloadedBoolean:()=>tK,spaceSeparated:()=>nK}),QG=0,$G=aK(),eK=aK(),tK=aK(),Q=aK(),nK=aK(),rK=aK(),iK=aK();function aK(){return 2**++QG}var oK=Object.keys(ZG),sK=class extends XG{constructor(e,t,n,r){let i=-1;if(super(e,t),cK(this,`space`,r),typeof n==`number`)for(;++i<oK.length;){let e=oK[i];cK(this,oK[i],(n&ZG[e])===ZG[e])}}};sK.prototype.defined=!0;function cK(e,t,n){n&&(e[t]=n)}function lK(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new sK(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[YG(r)]=r,n[YG(a.attribute)]=r}return new qG(t,n,e.space)}var uK=lK({properties:{ariaActiveDescendant:null,ariaAtomic:eK,ariaAutoComplete:null,ariaBusy:eK,ariaChecked:eK,ariaColCount:Q,ariaColIndex:Q,ariaColSpan:Q,ariaControls:nK,ariaCurrent:null,ariaDescribedBy:nK,ariaDetails:null,ariaDisabled:eK,ariaDropEffect:nK,ariaErrorMessage:null,ariaExpanded:eK,ariaFlowTo:nK,ariaGrabbed:eK,ariaHasPopup:null,ariaHidden:eK,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:nK,ariaLevel:Q,ariaLive:null,ariaModal:eK,ariaMultiLine:eK,ariaMultiSelectable:eK,ariaOrientation:null,ariaOwns:nK,ariaPlaceholder:null,ariaPosInSet:Q,ariaPressed:eK,ariaReadOnly:eK,ariaRelevant:null,ariaRequired:eK,ariaRoleDescription:nK,ariaRowCount:Q,ariaRowIndex:Q,ariaRowSpan:Q,ariaSelected:eK,ariaSetSize:Q,ariaSort:null,ariaValueMax:Q,ariaValueMin:Q,ariaValueNow:Q,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function dK(e,t){return t in e?e[t]:t}function fK(e,t){return dK(e,t.toLowerCase())}var pK=lK({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:rK,acceptCharset:nK,accessKey:nK,action:null,allow:null,allowFullScreen:$G,allowPaymentRequest:$G,allowUserMedia:$G,alt:null,as:null,async:$G,autoCapitalize:null,autoComplete:nK,autoFocus:$G,autoPlay:$G,blocking:nK,capture:null,charSet:null,checked:$G,cite:null,className:nK,cols:Q,colSpan:null,content:null,contentEditable:eK,controls:$G,controlsList:nK,coords:Q|rK,crossOrigin:null,data:null,dateTime:null,decoding:null,default:$G,defer:$G,dir:null,dirName:null,disabled:$G,download:tK,draggable:eK,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:$G,formTarget:null,headers:nK,height:Q,hidden:tK,high:Q,href:null,hrefLang:null,htmlFor:nK,httpEquiv:nK,id:null,imageSizes:null,imageSrcSet:null,inert:$G,inputMode:null,integrity:null,is:null,isMap:$G,itemId:null,itemProp:nK,itemRef:nK,itemScope:$G,itemType:nK,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:$G,low:Q,manifest:null,max:null,maxLength:Q,media:null,method:null,min:null,minLength:Q,multiple:$G,muted:$G,name:null,nonce:null,noModule:$G,noValidate:$G,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:$G,optimum:Q,pattern:null,ping:nK,placeholder:null,playsInline:$G,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:$G,referrerPolicy:null,rel:nK,required:$G,reversed:$G,rows:Q,rowSpan:Q,sandbox:nK,scope:null,scoped:$G,seamless:$G,selected:$G,shadowRootClonable:$G,shadowRootDelegatesFocus:$G,shadowRootMode:null,shape:null,size:Q,sizes:null,slot:null,span:Q,spellCheck:eK,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Q,step:null,style:null,tabIndex:Q,target:null,title:null,translate:null,type:null,typeMustMatch:$G,useMap:null,value:eK,width:Q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:nK,axis:null,background:null,bgColor:null,border:Q,borderColor:null,bottomMargin:Q,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:$G,declare:$G,event:null,face:null,frame:null,frameBorder:null,hSpace:Q,leftMargin:Q,link:null,longDesc:null,lowSrc:null,marginHeight:Q,marginWidth:Q,noResize:$G,noHref:$G,noShade:$G,noWrap:$G,object:null,profile:null,prompt:null,rev:null,rightMargin:Q,rules:null,scheme:null,scrolling:eK,standby:null,summary:null,text:null,topMargin:Q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Q,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:$G,disableRemotePlayback:$G,prefix:null,property:null,results:Q,security:null,unselectable:null},space:`html`,transform:fK}),mK=lK({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:iK,accentHeight:Q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Q,amplitude:Q,arabicForm:null,ascent:Q,attributeName:null,attributeType:null,azimuth:Q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Q,by:null,calcMode:null,capHeight:Q,className:nK,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Q,diffuseConstant:Q,direction:null,display:null,dur:null,divisor:Q,dominantBaseline:null,download:$G,dx:null,dy:null,edgeMode:null,editable:null,elevation:Q,enableBackground:null,end:null,event:null,exponent:Q,externalResourcesRequired:null,fill:null,fillOpacity:Q,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:rK,g2:rK,glyphName:rK,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Q,horizOriginX:Q,horizOriginY:Q,id:null,ideographic:Q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Q,k:Q,k1:Q,k2:Q,k3:Q,k4:Q,kernelMatrix:iK,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Q,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Q,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Q,overlineThickness:Q,paintOrder:null,panose1:null,path:null,pathLength:Q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:nK,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Q,pointsAtY:Q,pointsAtZ:Q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:iK,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:iK,rev:iK,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:iK,requiredFeatures:iK,requiredFonts:iK,requiredFormats:iK,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Q,specularExponent:Q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Q,strikethroughThickness:Q,string:null,stroke:null,strokeDashArray:iK,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Q,strokeOpacity:Q,strokeWidth:null,style:null,surfaceScale:Q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:iK,tabIndex:Q,tableValues:null,target:null,targetX:Q,targetY:Q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:iK,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Q,underlineThickness:Q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Q,values:null,vAlphabetic:Q,vMathematical:Q,vectorEffect:null,vHanging:Q,vIdeographic:Q,version:null,vertAdvY:Q,vertOriginX:Q,vertOriginY:Q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:dK}),hK=lK({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),gK=lK({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:fK}),_K=lK({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),vK=/[A-Z]/g,yK=/-[a-z]/g,bK=/^data[-\w.:]+$/i;function xK(e,t){let n=YG(t),r=t,i=XG;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&bK.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(yK,CK);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!yK.test(e)){let n=e.replace(vK,SK);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=sK}return new i(r,t)}function SK(e){return`-`+e.toLowerCase()}function CK(e){return e.charAt(1).toUpperCase()}var wK=JG([uK,pK,hK,gK,_K],`html`),TK=JG([uK,mK,hK,gK,_K],`svg`);function EK(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}var DK=/[#.]/g;function OK(e,t){let n=e||``,r={},i=0,a,o;for(;i<n.length;){DK.lastIndex=i;let e=DK.exec(n),t=n.slice(i,e?e.index:n.length);t&&(a?a===`#`?r.id=t:Array.isArray(r.className)?r.className.push(t):r.className=[t]:o=t,i+=t.length),e&&(a=e[0],i++)}return{type:`element`,tagName:o||t||`div`,properties:r,children:[]}}function kK(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function AK(e,t,n){let r=n?IK(n):void 0;function i(n,i,...a){let o;if(n==null){o={type:`root`,children:[]};let e=i;a.unshift(e)}else{o=OK(n,t);let s=o.tagName.toLowerCase(),c=r?r.get(s):void 0;if(o.tagName=c||s,jK(i))a.unshift(i);else for(let[t,n]of Object.entries(i))MK(e,o.properties,t,n)}for(let e of a)NK(o.children,e);return o.type===`element`&&o.tagName===`template`&&(o.content={type:`root`,children:o.children},o.children=[]),o}return i}function jK(e){if(typeof e!=`object`||!e||Array.isArray(e))return!0;if(typeof e.type!=`string`)return!1;let t=e,n=Object.keys(e);for(let e of n){let n=t[e];if(n&&typeof n==`object`){if(!Array.isArray(n))return!0;let e=n;for(let t of e)if(typeof t!=`number`&&typeof t!=`string`)return!0}}return!!(`children`in e&&Array.isArray(e.children))}function MK(e,t,n,r){let i=xK(e,n),a;if(r!=null){if(typeof r==`number`){if(Number.isNaN(r))return;a=r}else a=typeof r==`boolean`?r:typeof r==`string`?i.spaceSeparated?kK(r):i.commaSeparated?EK(r):i.commaOrSpaceSeparated?kK(EK(r).join(` `)):PK(i,i.property,r):Array.isArray(r)?[...r]:i.property===`style`?FK(r):String(r);if(Array.isArray(a)){let e=[];for(let t of a)e.push(PK(i,i.property,t));a=e}i.property===`className`&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function NK(e,t){if(t!=null)if(typeof t==`number`||typeof t==`string`)e.push({type:`text`,value:String(t)});else if(Array.isArray(t))for(let n of t)NK(e,n);else if(typeof t==`object`&&`type`in t)t.type===`root`?NK(e,t.children):e.push(t);else throw Error("Expected node, nodes, or string, got `"+t+"`")}function PK(e,t,n){if(typeof n==`string`){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===``||YG(n)===YG(t)))return!0}return n}function FK(e){let t=[];for(let[n,r]of Object.entries(e))t.push([n,r].join(`: `));return t.join(`; `)}function IK(e){let t=new Map;for(let n of e)t.set(n.toLowerCase(),n);return t}var LK=`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.solidColor.textArea.textPath`.split(`.`),RK=AK(wK,`div`);AK(TK,`g`,LK);var zK=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),BK={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function VK(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function HK(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function UK(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function WK(e){return UK(e)||VK(e)}var GK=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function KK(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,f=m(),p;for(a--;++a<=e.length;)if(p===10&&(d=(l?l[o]:0)||1),p=e.charCodeAt(a),p===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(p),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let _=``,v=``,y=``,b=u===`named`?WK:u===`decimal`?VK:HK;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!b(t))break;y+=String.fromCharCode(t),u===`named`&&zK.includes(y)&&(_=y,v=Ae(y))}let x=e.charCodeAt(l)===59;if(x){l++;let e=u===`named`?Ae(y):!1;e&&(_=y,v=e)}let S=1+l-o,C=``;if(!(!x&&n.nonTerminated===!1))if(!y)u!==`named`&&h(4,S);else if(u===`named`){if(x&&!v)h(5,1);else if(_!==y&&(l=c+_.length,S=1+l-c,x=!1),!x){let t=_?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(h(t,S),v=``):WK(n)?v=``:h(t,S)}else h(t,S)}C=v}else{x||h(2,S);let e=Number.parseInt(y,u===`hexadecimal`?16:10);if(qK(e))h(7,S),C=`�`;else if(e in BK)h(6,S),C=BK[e];else{let t=``;JK(e)&&h(6,S),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),C=t+String.fromCharCode(e)}}if(C){g(),f=m(),a=l-1,d+=l-o+1,i.push(C);let t=m();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,C,{start:f,end:t},e.slice(o-1,l)),f=t}else y=e.slice(o-1,l),s+=y,d+=y.length,a=l-1}else p===10&&(u++,o++,d=0),Number.isNaN(p)?g():(s+=String.fromCharCode(p),d++);return i.join(``);function m(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function h(e,t){let r;n.warning&&(r=m(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,GK[e],r,e))}function g(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:f,end:m()}),``)}}function qK(e){return e>=55296&&e<=57343||e>1114111}function JK(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}var YK=0,XK={},ZK={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++YK}),e.__id},clone:function e(t,n){n||={};var r,i;switch(ZK.util.type(t)){case`Object`:if(i=ZK.util.objId(t),n[i])return n[i];for(var a in r={},n[i]=r,t)t.hasOwnProperty(a)&&(r[a]=e(t[a],n));return r;case`Array`:return i=ZK.util.objId(t),n[i]?n[i]:(r=[],n[i]=r,t.forEach(function(t,i){r[i]=e(t,n)}),r);default:return t}}},languages:{plain:XK,plaintext:XK,text:XK,txt:XK,extend:function(e,t){var n=ZK.util.clone(ZK.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){r||=ZK.languages;var i=r[e],a={};for(var o in i)if(i.hasOwnProperty(o)){if(o==t)for(var s in n)n.hasOwnProperty(s)&&(a[s]=n[s]);n.hasOwnProperty(o)||(a[o]=i[o])}var c=r[e];return r[e]=a,ZK.languages.DFS(ZK.languages,function(t,n){n===c&&t!=e&&(this[t]=a)}),a},DFS:function e(t,n,r,i){i||={};var a=ZK.util.objId;for(var o in t)if(t.hasOwnProperty(o)){n.call(t,o,t[o],r||o);var s=t[o],c=ZK.util.type(s);c===`Object`&&!i[a(s)]?(i[a(s)]=!0,e(s,n,null,i)):c===`Array`&&!i[a(s)]&&(i[a(s)]=!0,e(s,n,o,i))}}},plugins:{},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(ZK.hooks.run(`before-tokenize`,r),!r.grammar)throw Error(`The language "`+r.language+`" has no grammar.`);return r.tokens=ZK.tokenize(r.code,r.grammar),ZK.hooks.run(`after-tokenize`,r),QK.stringify(ZK.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new tq;return nq(i,i.head,e),eq(e,i,t,i.head,0),iq(i)},hooks:{all:{},add:function(e,t){var n=ZK.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=ZK.hooks.all[e];if(!(!n||!n.length))for(var r=0,i;i=n[r++];)i(t)}},Token:QK};function QK(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||``).length|0}function $K(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var a=i[1].length;i.index+=a,i[0]=i[0].slice(a)}return i}function eq(e,t,n,r,i,a){for(var o in n)if(!(!n.hasOwnProperty(o)||!n[o])){var s=n[o];s=Array.isArray(s)?s:[s];for(var c=0;c<s.length;++c){if(a&&a.cause==o+`,`+c)return;var l=s[c],u=l.inside,d=!!l.lookbehind,f=!!l.greedy,p=l.alias;if(f&&!l.pattern.global){var m=l.pattern.toString().match(/[imsuy]*$/)[0];l.pattern=RegExp(l.pattern.source,m+`g`)}for(var h=l.pattern||l,g=r.next,_=i;g!==t.tail&&!(a&&_>=a.reach);_+=g.value.length,g=g.next){var v=g.value;if(t.length>e.length)return;if(!(v instanceof QK)){var y=1,b;if(f){if(b=$K(h,_,e,d),!b||b.index>=e.length)break;var x=b.index,S=b.index+b[0].length,C=_;for(C+=g.value.length;x>=C;)g=g.next,C+=g.value.length;if(C-=g.value.length,_=C,g.value instanceof QK)continue;for(var w=g;w!==t.tail&&(C<S||typeof w.value==`string`);w=w.next)y++,C+=w.value.length;y--,v=e.slice(_,C),b.index-=_}else if(b=$K(h,0,v,d),!b)continue;var x=b.index,T=b[0],E=v.slice(0,x),D=v.slice(x+T.length),ee=_+v.length;a&&ee>a.reach&&(a.reach=ee);var te=g.prev;E&&(te=nq(t,te,E),_+=E.length),rq(t,te,y);var ne=new QK(o,u?ZK.tokenize(T,u):T,p,T);if(g=nq(t,te,ne),D&&nq(t,g,D),y>1){var re={cause:o+`,`+c,reach:ee};eq(e,t,n,g.prev,_,re),a&&re.reach>a.reach&&(a.reach=re.reach)}}}}}}function tq(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function nq(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function rq(e,t,n){for(var r=t.next,i=0;i<n&&r!==e.tail;i++)r=r.next;t.next=r,r.prev=t,e.length-=i}function iq(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}var aq=ZK;function oq(){}oq.prototype=aq;var $=new oq;$.highlight=sq,$.register=cq,$.alias=lq,$.registered=uq,$.listLanguages=dq,$.util.encode=pq,$.Token.stringify=fq;function sq(e,t){if(typeof e!=`string`)throw TypeError("Expected `string` for `value`, got `"+e+"`");let n,r;if(t&&typeof t==`object`)n=t;else{if(r=t,typeof r!=`string`)throw TypeError("Expected `string` for `name`, got `"+r+"`");if(Object.hasOwn($.languages,r))n=$.languages[r];else throw Error("Unknown language: `"+r+"` is not registered")}return{type:`root`,children:aq.highlight.call($,e,n,r)}}function cq(e){if(typeof e!=`function`||!e.displayName)throw Error("Expected `function` for `syntax`, got `"+e+"`");Object.hasOwn($.languages,e.displayName)||e($)}function lq(e,t){let n=$.languages,r={};typeof e==`string`?t&&(r[e]=t):r=e;let i;for(i in r)if(Object.hasOwn(r,i)){let e=r[i],t=typeof e==`string`?[e]:e,a=-1;for(;++a<t.length;)n[t[a]]=n[i]}}function uq(e){if(typeof e!=`string`)throw TypeError("Expected `string` for `aliasOrLanguage`, got `"+e+"`");return Object.hasOwn($.languages,e)}function dq(){let e=$.languages,t=[],n;for(n in e)Object.hasOwn(e,n)&&typeof e[n]==`object`&&t.push(n);return t}function fq(e,t){if(typeof e==`string`)return{type:`text`,value:e};if(Array.isArray(e)){let n=[],r=-1;for(;++r<e.length;)e[r]!==null&&e[r]!==void 0&&e[r]!==``&&n.push(fq(e[r],t));return n}let n={attributes:{},classes:[`token`,e.type],content:fq(e.content,t),language:t,tag:`span`,type:e.type};return e.alias&&n.classes.push(...typeof e.alias==`string`?[e.alias]:e.alias),$.hooks.run(`wrap`,n),RK(n.tag+`.`+n.classes.join(`.`),mq(n.attributes),n.content)}function pq(e){return e}function mq(e){let t;for(t in e)Object.hasOwn(e,t)&&(e[t]=KK(e[t]));return e}$.register(dG),$.register(fG),$.register(pG),$.register(mG),$.register(hG),$.register(gG),$.register(_G),$.register(vG),$.register(yG),$.register(bG),$.register(xG),$.register(SG),$.register(CG),$.register(wG),$.register(TG),$.register(EG),$.register(DG),$.register(OG),$.register(kG),$.register(AG),$.register(jG),$.register(MG),$.register(NG),$.register(PG),$.register(FG),$.register(IG),$.register(LG),$.register(RG),$.register(zG),$.register(BG),$.register(VG),$.register(HG),$.register(UG),$.register(WG),$.register(GG),$.register(KG);function hq({...e}){return(0,h.jsx)(SF,{"data-slot":`popover`,...e})}function gq({...e}){return(0,h.jsx)(CF,{"data-slot":`popover-trigger`,...e})}function _q({container:e,className:t,align:n=`center`,sideOffset:r=4,...i}){return(0,h.jsx)(wF,{container:e??void 0,children:(0,h.jsx)(TF,{"data-slot":`popover-content`,align:n,sideOffset:r,className:QI(`z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,t),...i})})}var vq=new Set,yq=!1,bq=()=>typeof document<`u`,xq=e=>{Array.from(vq).forEach(t=>t(e))},Sq=()=>{yq||!bq()||(document.addEventListener(`scroll`,xq,{capture:!0,passive:!0}),yq=!0)},Cq=()=>{!yq||!bq()||(document.removeEventListener(`scroll`,xq,!0),yq=!1)},wq=e=>{if(!bq())return()=>void 0;let t=!0;return vq.add(e),Sq(),()=>{t&&(t=!1,vq.delete(e),vq.size===0&&Cq())}},Tq=e=>e?e.closest(`.zt-md-editor`)??e:null,Eq=(e,t)=>{let n=typeof window>`u`?e.bottom:window.innerHeight,r=e.top,i=n-e.bottom;return i<t&&r>i?`top`:`bottom`},Dq=(e,t)=>{let n=t.getBoundingClientRect();return{anchorTopInContent:e.top-n.top+t.scrollTop,anchorBottomInContent:e.bottom-n.top+t.scrollTop,anchorLeftInContent:e.left-n.left+t.scrollLeft}},Oq=e=>{let{wrapper:t,anchor:n,overlaySize:r,placement:i,offsetY:a,boundaryInset:o}=e,s=t.getBoundingClientRect(),c=t.scrollLeft+o,l=t.scrollLeft+t.clientWidth-r.width-o,u=Math.min(Math.max(n.anchorLeftInContent,c),Math.max(c,l)),d=i===`top`?n.anchorTopInContent-a:n.anchorBottomInContent+a;return{left:s.left+u-t.scrollLeft,top:s.top+d-t.scrollTop}},kq=(e,t)=>{let n=Oq(e),r=t.getBoundingClientRect();return{left:n.left-r.left,top:n.top-r.top}},Aq=e=>{let t=0,n=null,r=null,i=()=>{typeof window>`u`||(t&&window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{t=0,e()}))},a=()=>{window.addEventListener(`resize`,i),r||=wq(i)},o=()=>{window.removeEventListener(`resize`,i),r?.(),r=null},s=e=>{n!==e&&(n&&n.removeEventListener(`scroll`,i),n=e,n&&n.addEventListener(`scroll`,i,{passive:!0}))};return{schedule:i,bindGlobal:a,unbindGlobal:o,bindWrapper:s,destroy:()=>{typeof window<`u`&&t&&(window.cancelAnimationFrame(t),t=0),o(),s(null)}}},jq=`code_block`,Mq=`ZT_MD_CODE_BLOCK_LANGUAGE_PICKER`,Nq=104,Pq=36,Fq=`text`,Iq={javascript:`JavaScript`,typescript:`TypeScript`,jsx:`JSX`,tsx:`TSX`,json:`JSON`,html:`HTML`,css:`CSS`,bash:`Bash`,shell:`Shell`,sh:`Shell`,markdown:`Markdown`,md:`Markdown`,yaml:`YAML`,yml:`YAML`,sql:`SQL`,xml:`XML`},Lq=e=>e.trim().toLowerCase()||Fq,Rq=e=>{let t=Lq(e);return Iq[t]??t},zq=e=>{let t=$.listLanguages(),n=[...new Set(t.map(e=>Lq(e)).filter(e=>e!==Fq))].sort((e,t)=>e.localeCompare(t));return[{value:Fq,label:e.codeBlockLanguagePlainText},...n.map(e=>({value:e,label:Rq(e)}))]},Bq=e=>{let t=e.state.selection.$from;for(let e=t.depth;e>=0;--e){let n=t.node(e);if(n.type.name===jq)return{position:e===0?0:t.before(e),node:n}}return null},Vq=(e,t)=>{let n=e.nodeDOM(t);return n instanceof HTMLPreElement?n:n instanceof HTMLElement?n.querySelector(`pre`):null},Hq=e=>typeof e.props.editable==`function`?e.props.editable(e.state):e.editable,Uq=e=>{let[t,n]=(0,d.useState)(!1),[r,i]=(0,d.useState)(``),a=Lq(e.currentLanguage),o=Rq(a),s=(0,d.useMemo)(()=>zq(e.messages),[e.messages]),c=(0,d.useMemo)(()=>{let e=r.trim().toLowerCase();return e?s.filter(t=>{let n=t.label.toLowerCase(),r=t.value.toLowerCase();return n.includes(e)||r.includes(e)}):s},[r,s]);(0,d.useEffect)(()=>{n(!1),i(``)},[e.currentLanguage]);let l=e=>e instanceof HTMLElement?e.closest(`input, textarea, [contenteditable]:not([contenteditable="false"])`)!==null:!1,u=e=>{l(e.target)||e.preventDefault()},f=e=>{e.preventDefault()},p=t=>{e.onSelectLanguage(t),n(!1),i(``)};return(0,d.createElement)(hq,{open:t,onOpenChange:n},(0,d.createElement)(`div`,{className:`zt-md-code-language-picker`,onMouseDown:u},(0,d.createElement)(gq,{asChild:!0},(0,d.createElement)(`button`,{type:`button`,className:`zt-md-code-language-picker-trigger`,"aria-expanded":t,"aria-label":o},(0,d.createElement)(`span`,{className:`zt-md-code-language-picker-trigger-label`},o),(0,d.createElement)(bE,{className:`zt-md-code-language-picker-trigger-icon`,size:14,strokeWidth:2,"aria-hidden":`true`}))),(0,d.createElement)(_q,{align:`end`,side:`bottom`,sideOffset:6,className:`zt-md-code-language-picker-panel`,container:e.portalContainer,collisionBoundary:e.collisionBoundary,hideWhenDetached:!0,onOpenAutoFocus:f,onCloseAutoFocus:f},(0,d.createElement)(`label`,{className:`zt-md-code-language-picker-search`},(0,d.createElement)(UE,{className:`zt-md-code-language-picker-search-icon`,size:14,strokeWidth:2,"aria-hidden":`true`}),(0,d.createElement)(`input`,{value:r,onChange:e=>i(e.currentTarget.value),placeholder:e.messages.codeBlockLanguageSearchPlaceholder,className:`zt-md-code-language-picker-search-input`})),(0,d.createElement)(`div`,{className:`zt-md-code-language-picker-options`,role:`listbox`},c.length>0?c.map(e=>(0,d.createElement)(`button`,{key:e.value||`__plain_text__`,type:`button`,className:`zt-md-code-language-picker-option`,"data-selected":e.value===a?`true`:`false`,onClick:()=>p(e.value)},(0,d.createElement)(`span`,null,e.label),e.value===a?(0,d.createElement)(yE,{className:`zt-md-code-language-picker-option-check`,size:14,strokeWidth:2,"aria-hidden":`true`}):null)):(0,d.createElement)(`div`,{className:`zt-md-code-language-picker-empty`},`-`)))))},Wq=class{constructor(e,t,n){this.currentCodeBlockPosition=null,this.currentPreElement=null,this.currentRenderedLanguage=null,this.hasPositionContext=!1,this.repositionScheduler=Aq(()=>{this.hasPositionContext&&this.updateOverlayPosition()}),this.view=e,this.messages=t,this.portalContainer=n,this.editorWrapper=Tq(e.dom),this.host=document.createElement(`span`),this.host.className=`zt-md-code-language-picker-host`,this.hostRoot=(0,p.createRoot)(this.host),this.repositionScheduler.bindGlobal(),this.repositionScheduler.bindWrapper(this.editorWrapper),this.update(e)}applyLanguage(e){if(this.currentCodeBlockPosition===null)return;let t=this.view.state.doc.nodeAt(this.currentCodeBlockPosition);if(!t||t.type.name!==jq)return;let n=Lq(e),r={...t.attrs,language:n};if(Lq(String(t.attrs.language??``))===n)return;let i=this.view.state.tr.setNodeMarkup(this.currentCodeBlockPosition,t.type,r,t.marks);this.view.dispatch(i),this.view.focus()}render(e){this.currentRenderedLanguage!==null&&this.currentRenderedLanguage===e||(this.hostRoot.render((0,d.createElement)(Uq,{currentLanguage:e,messages:this.messages,portalContainer:this.portalContainer,collisionBoundary:this.editorWrapper,onSelectLanguage:e=>this.applyLanguage(e)})),this.host.dataset.mounted=`true`,this.currentRenderedLanguage=e)}detach(){this.hostRoot.render(null),delete this.host.dataset.mounted,this.host.remove(),this.currentCodeBlockPosition=null,this.currentPreElement=null,this.currentRenderedLanguage=null,this.hasPositionContext=!1}updateOverlayPosition(){if(!this.editorWrapper||!this.currentPreElement||this.host.parentElement!==this.portalContainer)return;let e=this.currentPreElement.getBoundingClientRect(),t=Dq(e,this.editorWrapper),n=kq({wrapper:this.editorWrapper,anchor:{anchorLeftInContent:t.anchorLeftInContent+e.width-Nq,anchorTopInContent:t.anchorTopInContent+e.height-Pq,anchorBottomInContent:t.anchorTopInContent+e.height-Pq},overlaySize:{width:96},placement:`top`,offsetY:0,boundaryInset:2},this.portalContainer);this.host.style.left=`${n.left}px`,this.host.style.top=`${n.top}px`}update(e){if(this.view=e,!Hq(e)||!this.editorWrapper){this.detach();return}let t=Bq(e);if(!t){this.detach();return}let n=Vq(e,t.position);if(!n){this.detach();return}this.host.parentElement!==this.portalContainer&&this.portalContainer.append(this.host);let r=Lq(String(t.node.attrs.language??``)),i=this.currentCodeBlockPosition===t.position&&this.currentPreElement===n&&this.currentRenderedLanguage!==null&&this.currentRenderedLanguage===r;this.currentCodeBlockPosition=t.position,this.currentPreElement=n,this.hasPositionContext=!0,this.updateOverlayPosition(),this.repositionScheduler.schedule(),!i&&this.render(r)}destroy(){this.detach(),this.repositionScheduler.destroy(),this.hostRoot.unmount()}},Gq=(e,t)=>zg(()=>new $c({key:new nl(Mq),view:n=>new Wq(n,e,t)})),Kq=`code_block`,qq=`a`,Jq=`zt-md-code-block-mod-a-select`,Yq=e=>e.key.toLowerCase()!==qq||e.defaultPrevented||e.altKey||e.shiftKey||!e.ctrlKey&&!e.metaKey,Xq=e=>{for(let t=e.depth;t>=0;--t){let n=e.node(t);if(n.type.name!==Kq)continue;let r=t===0?0:e.before(t);return{codeBlockStart:r+1,codeBlockEnd:r+n.nodeSize-1}}return null},Zq=(e,t)=>{let n=e.state.selection.$from,r=Xq(n);if(!r)return!1;let i=e.state.tr.setSelection(M.create(e.state.doc,r.codeBlockStart,r.codeBlockEnd));return t.preventDefault(),e.dispatch(i),!0},Qq=zg(()=>new $c({key:new nl(Jq),props:{handleKeyDown:(e,t)=>Yq(t)?!1:Zq(e,t)}})),$q=`code_block`,eJ=`ZT_MD_CODE_BLOCK_PRISM`,tJ=(e,t=[])=>e.flatMap(e=>{if(e.type===`element`){let n=[...t,...e.properties?.className??[]];return tJ(e.children??[],n)}return[{text:e.value??``,className:t}]}),nJ=(e,t)=>t.listLanguages().includes(e),rJ=(e,t)=>{let n=[];return yu(e=>e.type.name===$q)(e).forEach(e=>{let r=String(e.node.attrs.language??``);if(!r||!nJ(r,t))return;let i=e.pos+1;tJ(t.highlight(e.node.textContent,r).children).forEach(e=>{let t=i+e.text.length;e.className.length>0&&n.push(Em.inline(i,t,{class:e.className.join(` `)})),i=t})}),km.create(e,n)},iJ=zg(()=>{let e=$;return new $c({key:new nl(eJ),state:{init:(t,n)=>rJ(n.doc,e),apply:(t,n)=>t.docChanged?rJ(t.doc,e):n.map(t.mapping,t.doc)},props:{decorations(e){return this.getState(e)}}})}),aJ=class{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;constructor(e){this.#a=!1,this.onShow=()=>{},this.onHide=()=>{},this.#u=e=>{uP(e,this.element,{placement:this.#r.placement??`top`,middleware:[aP(),rP(this.#s),iP(this.#c),...this.#n],...this.#r}).then(({x:e,y:t})=>{Object.assign(this.element.style,{left:`${e}px`,top:`${t}px`})}).catch(console.error)},this.#d=e=>this.#i!==e.dom.parentElement,this.#f=(e,t)=>{let{state:n,composing:r}=e,{selection:i,doc:a}=n,{ranges:o}=i,s=Math.min(...o.map(e=>e.$from.pos)),c=Math.max(...o.map(e=>e.$to.pos)),l=t&&t.doc.eq(a)&&t.selection.eq(i);if(this.#a||=((this.#i??e.dom.parentElement??document.body).appendChild(this.element),!0),r||l)return;if(this.#o?.(),this.#o=void 0,!this.#t(e,t)){this.hide();return}let u={getBoundingClientRect:()=>mu(e,s,c),contextElement:e.dom};this.#d(e)?this.#o=nP(u,this.element,()=>this.#u(u)):this.#u(u),this.show()},this.update=(e,t)=>{this.#l(e,t)},this.#p=e=>{let{doc:t,selection:n}=e.state,{empty:r,from:i,to:a}=n,o=!t.textBetween(i,a).length&&e.state.selection instanceof M,s=this.element.contains(document.activeElement),c=!e.hasFocus()&&!s,l=!e.editable;return!(c||r||o||l)},this.destroy=()=>{this.#o?.(),this.#l.cancel()},this.show=(e,t)=>{if(this.element.dataset.show=`true`,e){this.#o?.(),this.#o=void 0;let n={...e,contextElement:t?.dom};t&&this.#d(t)?this.#o=nP(n,this.element,()=>this.#u(n)):this.#u(n)}this.onShow()},this.hide=()=>{this.element.dataset.show!==`false`&&(this.element.dataset.show=`false`,this.onHide())},this.element=e.content,this.#e=e.debounce??200,this.#t=e.shouldShow??this.#p,this.#s=e.offset,this.#c=e.shift,this.#n=e.middleware??[],this.#r=e.floatingUIOptions??{},this.#i=e.root,this.element.dataset.show=`false`,this.#l=hv(this.#f,this.#e)}#u;#d;#f;#p},oJ=`zt-md-selection-tooltip`,sJ=e=>[{command:`strong`,icon:vE,title:e.selectionTooltipStrongTitle,markNames:[`strong`]},{command:`em`,icon:IE,title:e.selectionTooltipEmTitle,markNames:[`em`,`emphasis`]},{command:`strike`,icon:qE,title:e.selectionTooltipStrikeTitle,markNames:[`strike_through`,`strikeThrough`]},{command:`inlineCode`,icon:CE,title:e.selectionTooltipInlineCodeTitle,markNames:[`inlineCode`,`code_inline`]},{command:`link`,icon:LE,title:e.selectionTooltipLinkTitle,markNames:[`link`]}],cJ={paragraph:eD,heading1:DE,heading2:OE,heading3:kE,heading4:AE,heading5:ME,heading6:jE,bulletList:VE,orderedList:zE,taskList:RE,blockquote:QE,codeBlock:CE},lJ=e=>[{command:`paragraph`,icon:cJ.paragraph,label:e.selectionTooltipTransformParagraphLabel},{command:`heading1`,icon:cJ.heading1,label:e.selectionTooltipTransformHeading1Label},{command:`heading2`,icon:cJ.heading2,label:e.selectionTooltipTransformHeading2Label},{command:`heading3`,icon:cJ.heading3,label:e.selectionTooltipTransformHeading3Label},{command:`heading4`,icon:cJ.heading4,label:e.selectionTooltipTransformHeading4Label},{command:`heading5`,icon:cJ.heading5,label:e.selectionTooltipTransformHeading5Label},{command:`heading6`,icon:cJ.heading6,label:e.selectionTooltipTransformHeading6Label},{command:`bulletList`,icon:cJ.bulletList,label:e.selectionTooltipTransformBulletListLabel},{command:`orderedList`,icon:cJ.orderedList,label:e.selectionTooltipTransformOrderedListLabel},{command:`taskList`,icon:cJ.taskList,label:e.selectionTooltipTransformTaskListLabel},{command:`blockquote`,icon:cJ.blockquote,label:e.selectionTooltipTransformBlockquoteLabel},{command:`codeBlock`,icon:cJ.codeBlock,label:e.selectionTooltipTransformCodeBlockLabel}],uJ=(e,t)=>e(t.state,t.dispatch,t),dJ=(e,t)=>{let n=e?.state?.selection?.$from;if(!n||!e?.dispatch)return!1;for(let r=n.depth;r>0;--r){let i=n.node(r);if(i?.type?.name!==`list_item`)continue;if(!i.type?.spec?.attrs?.checked)return!1;let a=n.before(r);return e.dispatch(e.state.tr.setNodeMarkup(a,void 0,{...i.attrs,checked:t})),!0}return!1},fJ={heading1:1,heading2:2,heading3:3,heading4:4,heading5:5,heading6:6},pJ={bulletList:`bullet_list`,orderedList:`ordered_list`},mJ=[`codeBlock`,`heading1`,`heading2`,`heading3`,`heading4`,`heading5`,`heading6`,`taskList`,`orderedList`,`bulletList`,`blockquote`,`paragraph`],hJ=async(e,t)=>{if(!e?.state||!e?.dispatch)return!1;let n=e.state.schema.nodes;if(t===`paragraph`){let t=n.paragraph;return t?uJ(kl(t),e):!1}if(t in fJ){let r=n.heading,i=fJ[t];return!r||typeof i!=`number`?!1:uJ(kl(r,{level:i}),e)}if(t===`blockquote`){let t=n.blockquote;return t?uJ(Ol(t),e):!1}if(t===`taskList`){let t=n.bullet_list;return!t||!uJ(bv(t),e)?!1:dJ(e,!1)}if(t===`codeBlock`){let t=n.code_block;return t?uJ(kl(t,{language:`text`}),e):!1}if(t in pJ){let r=n[pJ[t]];return r?uJ(bv(r),e):!1}return!1},gJ=e=>{let t=e.state.selection.$from,n=new Set;for(let e=t.depth;e>0;--e){let r=t.node(e),i=r.type.name;if(i===`code_block`){n.add(`codeBlock`);continue}if(i===`blockquote`){n.add(`blockquote`);continue}if(i===`heading`){let e={1:`heading1`,2:`heading2`,3:`heading3`,4:`heading4`,5:`heading5`,6:`heading6`}[Number(r.attrs?.level??0)];e&&n.add(e);continue}if(i===`list_item`){typeof r.attrs?.checked==`boolean`&&n.add(`taskList`);continue}if(i===`ordered_list`){n.add(`orderedList`);continue}if(i===`bullet_list`){n.add(`bulletList`);continue}i===`paragraph`&&n.add(`paragraph`)}return n.has(`taskList`)&&n.delete(`bulletList`),n.size===0&&n.add(`paragraph`),n},_J=e=>{let t=gJ(e);return mJ.find(e=>t.has(e))||`paragraph`},vJ=e=>typeof e.props.editable==`function`?e.props.editable(e.state):e.editable,yJ=(e,t)=>{let n=e.state.schema.marks,r=t.find(e=>n[e]);return r?n[r]??null:null},bJ=(e,t)=>{let{from:n,to:r}=e.selection;return e.doc.rangeHasMark(n,r,t)},xJ=(e,t)=>{let{from:n,to:r}=e.selection,i=``;return e.doc.nodesBetween(n,r,e=>{let n=e.marks.find(e=>e.type===t);return n?(i=typeof n.attrs.href==`string`?n.attrs.href:``,!1):!0}),i},SJ=e=>{Ml(e.markType)(e.view.state,e.view.dispatch,e.view),e.view.focus()},CJ=e=>{e.toggleLinkPopover(e.view)},wJ=(e,t)=>{({strong:SJ,em:SJ,strike:SJ,inlineCode:SJ,link:CJ})[e](t)},TJ=(e,t,n,r,i)=>{let a=document.createElement(`button`);a.type=`button`,a.className=`zt-md-selection-tooltip-button`,a.dataset.command=e.command,a.title=e.title,a.setAttribute(`aria-label`,e.title);let o=document.createElement(`span`);o.className=`zt-md-selection-tooltip-button-icon`;let s=(0,p.createRoot)(o);return s.render((0,d.createElement)(e.icon,{size:14,strokeWidth:2})),i.push(s),a.append(o),a.addEventListener(`mousedown`,e=>{e.preventDefault()}),a.addEventListener(`click`,i=>{i.preventDefault();let a=n();!a||a.state.selection.empty||wJ(e.command,{view:a,markType:t,toggleLinkPopover:r})}),a},EJ=(e,t,n,r,i,a)=>{let o=document.createElement(`div`);return o.className=`zt-md-selection-tooltip`,o.append(i),t.forEach(t=>{let i=yJ(e,t.markNames);i&&t.command!==`link`&&o.append(TJ(t,i,n,r,a))}),o},DJ=e=>{let t=e=>{e.preventDefault()},n=t=>{let n=e.getCurrentView();if(!n||n.state.selection.empty){e.onOpenChange(!1);return}hJ(n,t).then(()=>{e.onOpenChange(!1),n.focus()})};return(0,d.createElement)(hq,{open:e.open,onOpenChange:e.onOpenChange},(0,d.createElement)(gq,{asChild:!0},(0,d.createElement)(`button`,{type:`button`,className:`zt-md-selection-transform-trigger`,"aria-label":e.menuTitle,title:e.menuTitle,onMouseDown:t},(0,d.createElement)(`span`,{className:`zt-md-selection-transform-trigger-label`},e.activeLabel),(0,d.createElement)(bE,{size:e.iconSize,strokeWidth:e.iconStrokeWidth,"aria-hidden":`true`}))),(0,d.createElement)(_q,{container:e.portalContainer,collisionBoundary:e.collisionBoundary,hideWhenDetached:!0,align:`start`,sideOffset:8,className:`zt-md-selection-transform-popover !w-[176px] p-1`,onOpenAutoFocus:e=>e.preventDefault(),onCloseAutoFocus:e=>e.preventDefault()},(0,d.createElement)(`p`,{className:`zt-md-selection-transform-popover-title`},e.menuTitle),(0,d.createElement)(`div`,{className:`zt-md-selection-transform-popover-list`},...e.items.map(r=>{let i=e.activeCommands.has(r.command);return(0,d.createElement)(`button`,{key:r.command,type:`button`,className:`zt-md-selection-transform-item`,"data-active":i?`true`:`false`,onMouseDown:t,onClick:()=>n(r.command)},(0,d.createElement)(r.icon,{size:e.iconSize,strokeWidth:e.iconStrokeWidth,className:`zt-md-selection-transform-item-icon`,"aria-hidden":`true`}),(0,d.createElement)(`span`,{className:`zt-md-selection-transform-item-label`},r.label))}))))},OJ=e=>{let[t,n]=(0,d.useState)(``),r=(0,d.useRef)(null),i=e=>{e.preventDefault()},a=t=>{let n=e.getCurrentView();if(!n||n.state.selection.empty){e.onOpenChange(!1);return}let r=yJ(n,[`link`]);if(!r){e.onOpenChange(!1);return}let i=dO(t),{from:a,to:o}=n.state.selection,s=n.state.tr.removeMark(a,o,r);i&&s.addMark(a,o,r.create({href:i})),n.dispatch(s.scrollIntoView()),e.onOpenChange(!1),n.focus()};return(0,d.useEffect)(()=>{if(!e.open)return;let t=e.getCurrentView(),n=t?yJ(t,[`link`]):null;(!t||!n||t.state.selection.empty)&&e.onOpenChange(!1)},[e.open,e.getCurrentView,e.onOpenChange]),(0,d.useEffect)(()=>{e.open&&r.current?.focus()},[e.open]),(0,d.createElement)(hq,{open:e.open,onOpenChange:t=>{if(!t){e.onOpenChange(!1);return}let r=e.getCurrentView(),i=r?yJ(r,[`link`]):null;if(!r||!i||r.state.selection.empty){e.onOpenChange(!1);return}n(dO(xJ(r.state,i))),e.onOpenChange(!0)}},(0,d.createElement)(gq,{asChild:!0},(0,d.createElement)(`button`,{ref:e.triggerRef,type:`button`,className:`zt-md-selection-tooltip-button`,"data-command":`link`,title:e.messages.selectionTooltipLinkTitle,"aria-label":e.messages.selectionTooltipLinkTitle,onMouseDown:i},(0,d.createElement)(`span`,{className:`zt-md-selection-tooltip-button-icon`},(0,d.createElement)(LE,{size:e.iconSize,strokeWidth:e.iconStrokeWidth})))),(0,d.createElement)(_q,{container:e.portalContainer,collisionBoundary:e.collisionBoundary,hideWhenDetached:!0,align:`center`,sideOffset:8,className:`zt-md-selection-link-popover w-fit min-w-0 gap-0 p-2`,onOpenAutoFocus:e=>{e.preventDefault(),requestAnimationFrame(()=>{r.current?.focus()})},onCloseAutoFocus:e=>e.preventDefault()},(0,d.createElement)(`div`,{className:`zt-md-selection-link-popover-row`},(0,d.createElement)(`input`,{ref:r,type:`text`,value:t,placeholder:e.messages.selectionLinkInputPlaceholder,className:`zt-md-selection-link-popover-input`,onChange:e=>n(e.currentTarget.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),a(t.trim()))}}),(0,d.createElement)(eL,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`zt-md-selection-link-popover-action cursor-pointer bg-transparent hover:bg-transparent focus-visible:ring-0`,onMouseDown:i,onClick:()=>a(t.trim()),"aria-label":e.messages.selectionLinkSaveAriaLabel},(0,d.createElement)(yE,{size:e.iconSize,strokeWidth:e.iconStrokeWidth})),(0,d.createElement)(eL,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`zt-md-selection-link-popover-action cursor-pointer bg-transparent hover:bg-transparent focus-visible:ring-0`,onMouseDown:i,onClick:()=>a(``),"aria-label":e.messages.selectionLinkRemoveAriaLabel},(0,d.createElement)($E,{size:e.iconSize,strokeWidth:e.iconStrokeWidth})))))},kJ=(e,t,n)=>{n.forEach(n=>{let r=yJ(t,n.markNames);if(!r)return;let i=e.querySelector(`[data-command="${n.command}"]`);i instanceof HTMLButtonElement&&(i.dataset.active=bJ(t.state,r)?`true`:`false`)})},AJ=e=>{let{from:t,to:n}=e.state.selection,r=!1;return e.state.doc.nodesBetween(t,n,e=>e.type.name===`code_block`?(r=!0,!1):!0),r},jJ=(e,t,n)=>r=>{let{selection:i,doc:a}=r.state,o=e.contains(document.activeElement);return!vJ(r)||i.empty||!(i instanceof M)||!r.hasFocus()&&!o&&!t()&&!n()||AJ(r)?!1:e.childElementCount>0&&a.textBetween(i.from,i.to).trim().length>0},MJ=(e,t,n)=>{let r=sJ(n),i=lJ(n),a=e,o=!1,s=!1,c=[],l=document.createElement(`span`),u=(0,p.createRoot)(l),f=document.createElement(`span`),m=null,h=(0,p.createRoot)(f),g=t.closest(`.zt-md-editor`),_=e=>{o!==e&&(o=e,x())},v=e=>{s!==e&&(s=e,b())},y=e=>{e.state.selection.empty||_(!o)},b=()=>{let e=a?gJ(a):new Set([`paragraph`]),r=a?_J(a):`paragraph`,o=i.find(e=>e.command===r)??i[0];u.render((0,d.createElement)(DJ,{getCurrentView:()=>a,portalContainer:t,collisionBoundary:g,iconSize:14,iconStrokeWidth:2,menuTitle:n.selectionTooltipTransformLabel,items:i,activeLabel:o?.label??n.selectionTooltipTransformParagraphLabel,open:s,onOpenChange:v,activeCommands:e}))},x=()=>{h.render((0,d.createElement)(OJ,{getCurrentView:()=>a,portalContainer:t,collisionBoundary:g,iconSize:14,iconStrokeWidth:2,triggerRef:e=>{m=e},open:o,onOpenChange:_,messages:n}))},S=EJ(e,r,()=>a,y,l,c);b(),yJ(e,[`link`])&&(S.append(f),x());let C=new aJ({content:S,debounce:80,offset:8,root:t,shouldShow:jJ(S,()=>o,()=>s),floatingUIOptions:{placement:`top`}});return{update:(e,t)=>{if(a=e,a.state.selection.empty&&(_(!1),v(!1)),kJ(S,a,r),b(),m){let e=yJ(a,[`link`]);m.dataset.active=e&&bJ(a.state,e)?`true`:`false`}C.update(a,t)},destroy:()=>{a=null,u.unmount(),h.unmount(),c.splice(0).forEach(e=>{e.unmount()}),C.destroy(),S.remove()}}},NJ=(e,t)=>zg(()=>new $c({key:new nl(oJ),view:n=>MJ(n,e,t)})),PJ=(e,t)=>e(t.state,t.dispatch,t),FJ=e=>{let t=e?.state?.selection?.$from;if(!t)return!1;for(let e=t.depth;e>0;--e)if(t.node(e)?.type?.name===`table`)return!0;return!1},IJ=(e,t)=>{let n=e?.state?.doc;if(!n||typeof t!=`number`)return-1;let r=Math.min(Math.max(t,0),n.content.size),i=n.resolve(r);for(let e=i.depth;e>0;--e)if(i.node(e)?.type?.name===`table`)return i.before(e);return-1},LJ=(e,t,n,r)=>{let i=e?.state?.schema?.nodes;if(!i)return null;let a=i.table,o=i.table_header_row,s=i.table_row,c=i.table_header,l=i.table_cell;if(!a||!o||!s||!c||!l)return null;let u=Math.max(1,t),d=Math.max(1,n),f=Array.from({length:u},(e,t)=>{let n=r&&t===0,i=n?o:s,a=n?c:l,u=Array.from({length:d},()=>a.createAndFill()).filter(Boolean);return i.create(null,u)});return a.create(null,f)},RJ=async e=>{if(!e?.state||!e?.dispatch||FJ(e))return!1;let t=e.state.selection.from,n=LJ(e,3,3,!0);if(!n)return!1;e.dispatch(e.state.tr.replaceSelectionWith(n).scrollIntoView());let r=IJ(e,t);if(r<0&&t>0&&(r=IJ(e,t-1)),r<0)return!0;let i=r+2;if(i>e.state.doc.content.size)return!0;let a=M.near(e.state.doc.resolve(i),1);return e.dispatch(e.state.tr.setSelection(a).scrollIntoView()),e.focus(),!0},zJ=(e,t)=>{let n=e?.state?.schema?.marks??{},r=t.find(e=>n[e]);return r?n[r]??null:null},BJ=new Set([`paragraph`,`heading1`,`heading2`,`heading3`,`heading4`,`heading5`,`heading6`,`bulletList`,`orderedList`,`taskList`,`blockquote`,`codeBlock`]),VJ=e=>BJ.has(e),HJ=async e=>{let t=e?.state?.schema?.nodes?.math_inline;if(!t||!e?.dispatch)return!1;let n=e.state.selection.from,r=t.create({value:``});return e.dispatch(e.state.tr.replaceSelectionWith(r).setMeta(ZU,{type:`open`,position:n}).scrollIntoView()),!0},UJ=async(e,t)=>{if(!e?.state||!e?.dispatch)return!1;let n=e.state.schema?.nodes??{};if(VJ(t))return hJ(e,t);if(t===`inlineCode`){let t=zJ(e,[`inlineCode`,`code_inline`]);return t?PJ(Ml(t),e):!1}if(t===`inlineMath`)return HJ(e);if(t===`mathBlock`){let t=n.math_block;if(!t||!PJ(kl(t),e))return!1;let r=e.state.selection?.$from;if(!r)return!0;let i=null;for(let e=r.depth;e>0;--e)if(r.node(e)?.type?.name===`math_block`){i=r.before(e);break}if(i===null)return!0;let a=N.create(e.state.doc,i);return e.dispatch(e.state.tr.setSelection(a).scrollIntoView()),!0}return t===`table`?RJ(e):!1},WJ=e=>typeof e?.props?.editable==`function`?e.props.editable(e.state):!!e?.editable,GJ=[{id:`paragraph`,label:`普通文本`,group:`标题`,icon:`Type`,command:`paragraph`},{id:`heading-1`,label:`标题 1`,group:`标题`,icon:`Heading1`,command:`heading1`},{id:`heading-2`,label:`标题 2`,group:`标题`,icon:`Heading2`,command:`heading2`},{id:`heading-3`,label:`标题 3`,group:`标题`,icon:`Heading3`,command:`heading3`},{id:`heading-4`,label:`标题 4`,group:`标题`,icon:`Heading4`,command:`heading4`},{id:`heading-5`,label:`标题 5`,group:`标题`,icon:`Heading5`,command:`heading5`},{id:`heading-6`,label:`标题 6`,group:`标题`,icon:`Heading6`,command:`heading6`},{id:`bullet-list`,label:`无序列表`,group:`列表`,icon:`List`,command:`bulletList`},{id:`ordered-list`,label:`有序列表`,group:`列表`,icon:`ListOrdered`,command:`orderedList`},{id:`task-list`,label:`任务列表`,group:`列表`,icon:`ListTodo`,command:`taskList`},{id:`blockquote`,label:`引用块`,group:`插入`,icon:`TextQuote`,command:`blockquote`},{id:`inline-code`,label:`行内代码`,group:`插入`,icon:`Code`,command:`inlineCode`},{id:`code-block`,label:`代码块`,group:`插入`,icon:`SquareCode`,command:`codeBlock`},{id:`table`,label:`表格`,group:`插入`,icon:`Table`,command:`table`},{id:`inline-math`,label:`行内公式`,group:`公式`,icon:`Sigma`,command:`inlineMath`},{id:`math-block`,label:`公式块`,group:`公式`,icon:`SquareFunction`,command:`mathBlock`},{id:`image`,label:`图片`,group:`媒体`,icon:`Image`,command:`image`}],KJ=[{id:`paragraph`,label:`Paragraph`,group:`Headings`,icon:`Type`,command:`paragraph`},{id:`heading-1`,label:`Heading 1`,group:`Headings`,icon:`Heading1`,command:`heading1`},{id:`heading-2`,label:`Heading 2`,group:`Headings`,icon:`Heading2`,command:`heading2`},{id:`heading-3`,label:`Heading 3`,group:`Headings`,icon:`Heading3`,command:`heading3`},{id:`heading-4`,label:`Heading 4`,group:`Headings`,icon:`Heading4`,command:`heading4`},{id:`heading-5`,label:`Heading 5`,group:`Headings`,icon:`Heading5`,command:`heading5`},{id:`heading-6`,label:`Heading 6`,group:`Headings`,icon:`Heading6`,command:`heading6`},{id:`bullet-list`,label:`Bullet list`,group:`Lists`,icon:`List`,command:`bulletList`},{id:`ordered-list`,label:`Ordered list`,group:`Lists`,icon:`ListOrdered`,command:`orderedList`},{id:`task-list`,label:`Task list`,group:`Lists`,icon:`ListTodo`,command:`taskList`},{id:`blockquote`,label:`Blockquote`,group:`Insert`,icon:`TextQuote`,command:`blockquote`},{id:`inline-code`,label:`Inline code`,group:`Insert`,icon:`Code`,command:`inlineCode`},{id:`code-block`,label:`Code block`,group:`Insert`,icon:`SquareCode`,command:`codeBlock`},{id:`table`,label:`Table`,group:`Insert`,icon:`Table`,command:`table`},{id:`inline-math`,label:`Inline math`,group:`Math`,icon:`Sigma`,command:`inlineMath`},{id:`math-block`,label:`Math block`,group:`Math`,icon:`SquareFunction`,command:`mathBlock`},{id:`image`,label:`Image`,group:`Media`,icon:`Image`,command:`image`}],qJ=(e,t=`zh-CN`)=>e?.items&&e.items.length>0?e.items:t===`en-US`?KJ:GJ,JJ=e=>{let t=e?.state?.selection?.$from;if(!t)return!1;let n=String(t.parent?.type?.name??``);if(n.includes(`code`)||n===`math_block`)return!0;for(let e=t.depth;e>0;--e){let n=String(t.node(e)?.type?.name??``);if(n===`table`||n===`table_cell`||n===`table_header`)return!0}return!1},YJ=e=>{let t=e?.state,n=t?.selection?.$from;if(!t||!n)return``;let r=n.start(),i=n.pos;return t.doc.textBetween(r,i,`
|
|
310
362
|
`,`
|
|
311
|
-
`)},
|
|
363
|
+
`)},XJ=e=>{let t=YJ(e),n=t.lastIndexOf(`/`);if(n<0)return null;let r=t.slice(n+1);return/\s/.test(r)?null:r},ZJ=(e,t)=>{if(t===null||t.length===0)return e;let n=t.toLowerCase();return e.filter(e=>[e.label,e.group,e.command,e.id].some(e=>String(e).toLowerCase().startsWith(n)))},QJ=(e,t)=>{if(!WJ(e))return{visibleItems:[],shouldShow:!1};let n=XJ(e),r=ZJ(t,n);return{visibleItems:r,shouldShow:!JJ(e)&&n!==null&&r.length>0}},$J=e=>{let t=e?.state,n=t?.selection?.$from;if(!t||!n||!e?.dispatch)return!1;let r=n.start(),i=n.pos,a=t.doc.textBetween(r,i,`
|
|
312
364
|
`,`
|
|
313
|
-
`).lastIndexOf(`/`);if(a<0)return!1;let o=r+a,s=t.tr.delete(o,i);return e.dispatch(s.scrollIntoView()),!0},ox={Type:rt,Heading1:Ae,Heading2:je,Heading3:Me,Heading4:Ne,Heading5:Fe,Heading6:Pe,Image:Re,List:We,ListOrdered:He,ListTodo:Ue,Code:De,SquareFunction:Ye,SquareCode:Je,TextQuote:tt,Sigma:qe,Table:Ze},sx=Te,cx=(e,t,n,r)=>{r.splice(0).forEach(e=>{e.unmount()}),e.innerHTML=``;let i=``;t.forEach((t,a)=>{if(t.group!==i){let n=document.createElement(`div`);n.className=`slash-menu-group`,n.textContent=t.group,e.appendChild(n),i=t.group}let o=document.createElement(`div`);o.className=`slash-menu-item`,o.dataset.command=t.command,o.dataset.selected=a===n?`true`:`false`;let s=document.createElement(`span`);s.className=`slash-menu-item-icon`;let c=t.icon?ox[t.icon]??sx:null;if(c){let e=(0,f.createRoot)(s);e.render((0,u.createElement)(c,{size:16,strokeWidth:2})),r.push(e)}let l=document.createElement(`span`);l.className=`slash-menu-item-label`,l.textContent=t.label,o.appendChild(s),o.appendChild(l),e.appendChild(o)})},lx=e=>{let t=document.createElement(`div`);t.className=`slash-menu`,t.style.display=`none`,e.appendChild(t);let n=!1,r=``,i=!1,a=null,o=[],s=()=>{if(!n||!a)return;let{editorWrapper:r,anchorTopInContent:i,anchorBottomInContent:o,anchorLeftInContent:s,placement:c,offsetY:l}=a,u=My({wrapper:r,anchor:{anchorTopInContent:i,anchorBottomInContent:o,anchorLeftInContent:s},overlaySize:{width:t.offsetWidth||210},placement:c,offsetY:l,boundaryInset:4},e);t.style.left=`${u.left}px`,t.style.top=`${u.top}px`,t.dataset.placement=c},c=Ny(()=>{n&&s()}),l=()=>{t.style.top=``,t.style.left=``,t.style.transform=``,delete t.dataset.placement};return{menu:t,isVisible:()=>n,setVisible:(e,a)=>{if(n!==e){if(n=e,t.style.display=e?`block`:`none`,!e){c.unbindGlobal(),c.bindWrapper(null),l(),r=``,i=!0;return}c.bindGlobal(),a&&(a(),i&&=(a(),!1))}},renderIfNeeded:(e,n)=>{let i=`${e.map(e=>e.command).join(`|`)}::${n}`;r!==i&&(cx(t,e,n,o),r=i)},scrollActiveItemIntoView:e=>{let n=t.querySelector(`.slash-menu-item[data-selected="true"]`);n&&(n.scrollIntoView({block:`nearest`,inline:`nearest`}),e&&e())},updatePositionContext:e=>{a=e,c.bindWrapper(e?.editorWrapper??null)},updatePosition:s,destroy:()=>{o.splice(0).forEach(e=>{e.unmount()}),c.destroy(),t.remove()}}},ux=(e,t)=>{if(!(!e||typeof e!=`object`))return e[t]},dx=async()=>{let e=(await Promise.resolve().then(()=>require("./lib-Dka_BhhQ.cjs"))).slashFactory;if(typeof e!=`function`)return console.error(`[zt-md/slash] slashFactory not found`),null;let t=e(`zt-md-slash`),n=Array.isArray(t)?t[0]:void 0,r=Array.isArray(t)?t[1]:t,i=Array.isArray(t)?t[2]:void 0;if(!r)return null;let a=Array.isArray(t)?t.filter((e,t)=>t<2&&e!=null):[r],o=ux(n,`key`)??ux(r,`key`)??ux(i,`key`)??ux(t,`key`);return a.length===0||o===void 0?null:{plugins:a,key:o}},fx=async(e,t,n,r,i=`zh-CN`)=>{if(t?.enabled===!1)return{plugins:[],config:null};try{let a=await dx();if(!a)return{plugins:[],config:null};let o=$b(t,i),s=lx(e),c=0,l=null,u=o,d=!1,f=new Set([`ArrowDown`,`ArrowUp`,`Enter`,`Escape`]),p=e=>!f.has(e.key)||!d?!1:e.key===`ArrowDown`?(e.preventDefault(),u.length===0?!0:(c=(c+1)%u.length,s.renderIfNeeded(u,c),s.scrollActiveItemIntoView(()=>{s.updatePosition()}),!0)):e.key===`ArrowUp`?(e.preventDefault(),u.length===0?!0:(c=(c-1+u.length)%u.length,s.renderIfNeeded(u,c),s.scrollActiveItemIntoView(()=>{s.updatePosition()}),!0)):e.key===`Enter`?(e.preventDefault(),g(),!0):e.key===`Escape`?(e.preventDefault(),s.setVisible(!1),!0):!1,m=e=>{let t=e?.state?.selection?.from;if(typeof t!=`number`)return null;let n=e?.coordsAtPos?.(t);return n?new DOMRect(n.left,n.top,Math.max(n.right-n.left,1),n.bottom-n.top):null},h=e=>{if(!Xb(e)){u=[],d=!1,s.updatePositionContext(null),s.setVisible(!1);return}let t=ix(e,o);if(u=t.visibleItems,d=t.shouldShow,t.shouldShow&&c>=u.length&&(c=0),t.shouldShow&&!s.isVisible()&&(c=0),!t.shouldShow){s.updatePositionContext(null),s.setVisible(!1);return}let n=m(e),r=Oy(e?.dom);if(n&&r){let e=ky(n,320),t=Ay(n,r);s.updatePositionContext({editorWrapper:r,anchorTopInContent:t.anchorTopInContent,anchorBottomInContent:t.anchorBottomInContent,anchorLeftInContent:t.anchorLeftInContent,placement:e,offsetY:8})}s.renderIfNeeded(u,c),s.isVisible()?s.updatePosition():s.setVisible(!0,()=>{s.updatePosition()})},g=async()=>{if(!Xb(l)){d=!1,s.updatePositionContext(null),s.setVisible(!1);return}if(!l||c<0||c>=u.length)return;let t=u[c];if(ax(l)){if(t.command===`image`){s.setVisible(!1),n&&Ol({portalContainer:e,view:l,messages:n,imageUpload:r});return}await Yb(l,t.command)&&(s.setVisible(!1),t.command===`mathBlock`&&queueMicrotask(()=>{let e=l?.dom?.querySelector?.(`.zt-md-math-block-editing .zt-md-math-block-textarea`);!e||document.activeElement===e||e.focus()}))}};return s.menu.addEventListener(`mousedown`,e=>{e.preventDefault();let t=(e.target?.closest(`.slash-menu-item`))?.dataset.command??``;if(!t)return;let n=u.findIndex(e=>e.command===t);n<0||(c=n,g())}),{plugins:a.plugins,config:e=>{e.set(a.key,{props:{handleKeyDown:(e,t)=>p(t)},view:()=>({update:e=>{l=e,h(e)},destroy:()=>{d=!1,s.destroy()}})})}}}catch(e){return console.error(`[zt-md/slash] init failed`,e),{plugins:[],config:null}}},px=`table`,mx=`ArrowUp`,hx=e=>e.key!==mx||e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey,gx=(e,t)=>{let n=t.nodeBefore;return!n||n.type.name!==px?null:{tableNode:n,tableStart:e-n.nodeSize}},_x=e=>{if(e.parent.type.name!==`paragraph`||e.parentOffset!==0||e.parent.childCount>0||e.depth<1)return null;let t=e.index(e.depth-1);if(t<=0)return null;let n=e.node(e.depth-1).child(t-1);return n.type.name===px?{tableNode:n,tableStart:e.before(e.depth)-n.nodeSize}:null},vx=(e,t)=>{if(e.childCount===0)return null;let n=e.childCount-1,r=e.child(n);if(r.childCount===0)return null;let i=0;for(let t=0;t<n;t+=1)i+=e.child(t).nodeSize;let a=r.childCount-1,o=r.child(a),s=0;for(let e=0;e<a;e+=1)s+=r.child(e).nodeSize;return t+1+i+1+s+o.nodeSize-1},yx=e=>{let{selection:n}=e.state,r=n.$from,i=null;if(n instanceof D?i=gx(n.from,r):n.empty&&(i=_x(r)),!i)return!1;let a=vx(i.tableNode,i.tableStart);if(a===null)return!1;let o=e.state.tr.setSelection(t.c.near(e.state.doc.resolve(a),-1)).scrollIntoView();return e.dispatch(o),e.focus(),!0},bx=r.u(()=>new t.i({key:new t.a(`zt-md-table-arrow-entry`),props:{handleKeyDown:(e,t)=>hx(t)?!1:yx(e)}})),xx=`table`,Sx=`table_header_row`,Cx=`table_row`,wx=`table_header`,Tx=`table_cell`,Ex=e=>{let t=e.selection.$from,n=-1,r=-1;for(let e=t.depth;e>=0;--e){let i=t.node(e);if(r<0&&(i.type.name===Tx||i.type.name===wx)&&(r=t.index(e-1)),n<0&&(i.type.name===Cx||i.type.name===Sx)&&(n=t.index(e-1)),i.type.name===xx)return{tableNode:i,tableStart:e===0?0:t.before(e),tableNodeSize:i.nodeSize,rowIndex:n,columnIndex:r}}return null},Dx=(e,t,n,r)=>{if(n<0||n>=e.childCount)return null;let i=0;for(let t=0;t<n;t+=1)i+=e.child(t).nodeSize;let a=e.child(n);if(r<0||r>=a.childCount)return null;let o=0;for(let e=0;e<r;e+=1)o+=a.child(e).nodeSize;return t+1+i+1+o+1+1},Ox=e=>{if(e.columnIndex<0||e.tableNode.childCount===0)return!1;let t=e.tableNode.child(0);return e.columnIndex<t.childCount},kx=(e,n,r,i)=>{let a=Dx(n.tableNode,n.tableStart,r,i);if(a===null)return!1;let o=e.state.tr.setSelection(t.c.near(e.state.tr.doc.resolve(a),1));return e.dispatch(o),!0},Ax=(e,t)=>t(e.state,e.dispatch,e)?(e.dispatch(e.state.tr.scrollIntoView()),e.focus(),!0):!1,jx=(e,t,n)=>t.rowIndex<0||t.columnIndex<0||!kx(e,t,t.rowIndex,t.columnIndex)?!1:Ax(e,n===`above`?c.o:c.a),Mx=(e,t)=>t.rowIndex<=0||t.columnIndex<0||!kx(e,t,t.rowIndex,t.columnIndex)?!1:Ax(e,c.l),Nx=(e,t,n)=>t.rowIndex<0||t.columnIndex<0||!kx(e,t,t.rowIndex,t.columnIndex)?!1:Ax(e,n===`left`?c.i:c.r),Px=(e,t)=>t.rowIndex<0||t.columnIndex<0||(t.tableNode.childCount>0?t.tableNode.child(0).childCount:0)<=1||!kx(e,t,t.rowIndex,t.columnIndex)?!1:Ax(e,c.c),Fx=(e,t,n)=>{if(t.columnIndex<0)return!1;let r=c.n.get(t.tableNode),i=t.tableStart+1,a=t.columnIndex,o=e.state.tr;for(let e=0;e<r.height;e+=1){let t=e*r.width+a,s=r.map[t];if(typeof s!=`number`)continue;let c=i+s,l=o.doc.nodeAt(c);if(!l)continue;let u={...l.attrs,alignment:n};o.setNodeMarkup(c,l.type,u,l.marks)}return o.docChanged?(o.scrollIntoView(),e.dispatch(o),e.focus(),!0):!1},Ix=e=>{let t=Ex(e.state);!t||t.rowIndex<=0||Mx(e,t)},Lx=e=>{let t=Ex(e.state);!t||t.rowIndex<0||t.columnIndex<0||Px(e,t)},Rx=e=>{let[t,n]=(0,u.useState)(!1);Dy(t,()=>n(!1));let r=e=>{e.preventDefault()},i=e=>{n(e)},a=e=>{e.preventDefault()};return(0,u.createElement)(_y,{open:t,onOpenChange:i},(0,u.createElement)(vy,{asChild:!0},(0,u.createElement)(`button`,{type:`button`,className:`zt-md-table-action-button`,"aria-label":e.messages.tableMoreAriaLabel,onMouseDown:r},(0,u.createElement)(ke,{size:14,strokeWidth:2,"aria-hidden":`true`}))),(0,u.createElement)(yy,{align:`end`,sideOffset:6,className:`zt-md-table-action-popover`,container:e.portalContainer,onOpenAutoFocus:a,onCloseAutoFocus:a},(0,u.createElement)(`div`,{className:`zt-md-table-action-menu-group`},(0,u.createElement)(ol,{type:`button`,variant:`ghost`,size:`sm`,className:`zt-md-table-action-menu-item disabled:pointer-events-auto disabled:cursor-not-allowed`,disabled:!e.canInsertRowAbove,onMouseDown:r,onClick:()=>{e.onInsertRowAbove(),n(!1)}},e.messages.tableInsertRowAboveLabel),(0,u.createElement)(ol,{type:`button`,variant:`ghost`,size:`sm`,className:`zt-md-table-action-menu-item disabled:pointer-events-auto disabled:cursor-not-allowed`,onMouseDown:r,onClick:()=>{e.onInsertRowBelow(),n(!1)}},e.messages.tableInsertRowBelowLabel),(0,u.createElement)(ol,{type:`button`,variant:`ghost`,size:`sm`,className:`zt-md-table-action-menu-item disabled:pointer-events-auto disabled:cursor-not-allowed`,disabled:!e.canInsertColumn,onMouseDown:r,onClick:()=>{e.onInsertColumnLeft(),n(!1)}},e.messages.tableInsertColumnLeftLabel),(0,u.createElement)(ol,{type:`button`,variant:`ghost`,size:`sm`,className:`zt-md-table-action-menu-item disabled:pointer-events-auto disabled:cursor-not-allowed`,disabled:!e.canInsertColumn,onMouseDown:r,onClick:()=>{e.onInsertColumnRight(),n(!1)}},e.messages.tableInsertColumnRightLabel)),(0,u.createElement)(`div`,{className:`zt-md-table-action-menu-divider`,"aria-hidden":`true`}),(0,u.createElement)(`div`,{className:`zt-md-table-action-menu-group`},(0,u.createElement)(ol,{type:`button`,variant:`ghost`,size:`sm`,className:`zt-md-table-action-menu-item zt-md-table-action-menu-item-danger disabled:pointer-events-auto disabled:cursor-not-allowed`,disabled:!e.canDeleteRow,onMouseDown:r,onClick:()=>{e.onDeleteRow(),n(!1)}},e.messages.tableDeleteRowLabel),(0,u.createElement)(ol,{type:`button`,variant:`ghost`,size:`sm`,className:`zt-md-table-action-menu-item zt-md-table-action-menu-item-danger disabled:pointer-events-auto disabled:cursor-not-allowed`,disabled:!e.canDeleteColumn,onMouseDown:r,onClick:()=>{e.onDeleteColumn(),n(!1)}},e.messages.tableDeleteColumnLabel))))},zx=`zt-md-table-focus-actions`,Bx=0,Vx=24,Hx=4,Ux=4,Wx=`top`,Gx=`left`,Kx=e=>(0,d.renderToStaticMarkup)((0,u.createElement)(e,{size:14,strokeWidth:2,"aria-hidden":`true`})),qx=Kx(nt),Jx=Kx(et),Yx=Kx($e),Xx=Kx(Qe),Zx=e=>typeof e.props.editable==`function`?e.props.editable(e.state):e.editable,Qx=class{constructor(e,t,n){this.currentTableStart=null,this.currentTableNodeSize=null,this.currentColumnIndex=null,this.currentColumnAlignment=Gx,this.currentTableElement=null,this.hasPositionContext=!1,this.repositionScheduler=Ny(()=>{this.hasPositionContext&&this.updateOverlayPosition()}),this.handleActionsMouseDown=e=>{e.preventDefault()},this.handleDeleteClick=e=>{if(e.preventDefault(),this.currentTableStart===null||this.currentTableNodeSize===null)return;let t=this.currentTableStart,n=this.currentTableStart+this.currentTableNodeSize,r=this.view.state.tr.delete(t,n).scrollIntoView();this.view.dispatch(r),this.view.focus()},this.handleAlignLeftClick=()=>{this.applyColumnAlignment(`left`)},this.handleAlignCenterClick=()=>{this.applyColumnAlignment(`center`)},this.handleAlignRightClick=()=>{this.applyColumnAlignment(`right`)},this.handleInsertRowBelow=()=>{let e=Ex(this.view.state);!e||e.rowIndex<0||jx(this.view,e,`below`)},this.handleInsertRowAbove=()=>{let e=Ex(this.view.state);!e||e.rowIndex<=0||jx(this.view,e,`above`)},this.handleInsertColumnLeft=()=>{this.insertColumn(`left`)},this.handleInsertColumnRight=()=>{this.insertColumn(`right`)},this.handleDeleteRow=()=>{Ix(this.view)},this.handleDeleteColumn=()=>{Lx(this.view)},this.view=e,this.messages=t,this.portalContainer=n,this.editorWrapper=Oy(e.dom),this.actionsContainer=document.createElement(`div`),this.actionsContainer.className=`zt-md-table-actions-overlay`,this.deleteButton=document.createElement(`button`),this.deleteButton.type=`button`,this.deleteButton.className=`zt-md-table-action-button zt-md-table-action-button-danger`,this.deleteButton.style.display=`inline-flex`,this.deleteButton.setAttribute(`aria-label`,t.tableDeleteAriaLabel),this.deleteButton.innerHTML=qx,this.alignLeftButton=this.createColumnAlignmentButton(t.tableAlignLeftAriaLabel,Jx),this.alignCenterButton=this.createColumnAlignmentButton(t.tableAlignCenterAriaLabel,Yx),this.alignRightButton=this.createColumnAlignmentButton(t.tableAlignRightAriaLabel,Xx),this.moreActionsMount=document.createElement(`span`),this.moreActionsMount.className=`zt-md-table-more-actions-mount`,this.moreActionsRoot=(0,f.createRoot)(this.moreActionsMount),this.actionsContainer.append(this.moreActionsMount,this.alignLeftButton,this.alignCenterButton,this.alignRightButton,this.deleteButton),this.actionsContainer.addEventListener(`mousedown`,this.handleActionsMouseDown),this.deleteButton.addEventListener(`click`,this.handleDeleteClick),this.alignLeftButton.addEventListener(`click`,this.handleAlignLeftClick),this.alignCenterButton.addEventListener(`click`,this.handleAlignCenterClick),this.alignRightButton.addEventListener(`click`,this.handleAlignRightClick),this.repositionScheduler.bindGlobal(),this.repositionScheduler.bindWrapper(this.editorWrapper),this.update(e)}createColumnAlignmentButton(e,t){let n=document.createElement(`button`);return n.type=`button`,n.className=`zt-md-table-action-button`,n.style.display=`inline-flex`,n.setAttribute(`aria-label`,e),n.innerHTML=t,n}resolveColumnAlignment(e){return e===`center`||e===`right`?e:Gx}updateAlignmentButtonsState(e){this.alignLeftButton.disabled=!e,this.alignCenterButton.disabled=!e,this.alignRightButton.disabled=!e,this.alignLeftButton.classList.toggle(`zt-md-table-action-button-active`,e&&this.currentColumnAlignment===`left`),this.alignCenterButton.classList.toggle(`zt-md-table-action-button-active`,e&&this.currentColumnAlignment===`center`),this.alignRightButton.classList.toggle(`zt-md-table-action-button-active`,e&&this.currentColumnAlignment===`right`)}applyColumnAlignment(e){let t=Ex(this.view.state);!t||t.rowIndex<0||t.columnIndex<0||Fx(this.view,t,e)}insertColumn(e){let t=Ex(this.view.state);!t||t.rowIndex<0||t.columnIndex<0||Nx(this.view,t,e)}renderMoreActions(e,t,n,r){this.moreActionsRoot.render((0,u.createElement)(Rx,{messages:this.messages,portalContainer:this.portalContainer,canInsertRowAbove:e,canInsertColumn:t,canDeleteRow:n,canDeleteColumn:r,onInsertRowAbove:this.handleInsertRowAbove,onInsertRowBelow:this.handleInsertRowBelow,onInsertColumnLeft:this.handleInsertColumnLeft,onInsertColumnRight:this.handleInsertColumnRight,onDeleteRow:this.handleDeleteRow,onDeleteColumn:this.handleDeleteColumn}))}resolveTableElement(e){if(e instanceof HTMLTableElement)return e;let t=e.querySelector(`table`);return t instanceof HTMLTableElement?t:null}resolveTableAnchor(e,t){if(!this.editorWrapper)return null;let n=e.getBoundingClientRect(),r=Ay(n,this.editorWrapper),i=n.width,a=r.anchorLeftInContent+i-t-Bx,o=r.anchorTopInContent-Vx+Hx;return{anchorLeftInContent:a,anchorTopInContent:o,anchorBottomInContent:o}}resolveActionsContainerWidth(){let e=this.actionsContainer.getBoundingClientRect().width;return e<=0?null:e}updateOverlayPosition(){if(!this.editorWrapper||!this.currentTableElement||this.actionsContainer.parentElement!==this.portalContainer)return;let e=this.resolveActionsContainerWidth();if(e===null)return;let t=this.resolveTableAnchor(this.currentTableElement,e);if(!t)return;let n=My({wrapper:this.editorWrapper,anchor:t,overlaySize:{width:e},placement:Wx,offsetY:0,boundaryInset:Ux},this.portalContainer);this.actionsContainer.style.left=`${n.left}px`,this.actionsContainer.style.top=`${n.top}px`}update(e){if(this.view=e,!this.editorWrapper||!Zx(e)){this.detach();return}let t=Ex(e.state);if(!t){this.detach();return}let n=e.nodeDOM(t.tableStart);if(!(n instanceof HTMLElement)){this.detach();return}let r=this.resolveTableElement(n);if(!r){this.detach();return}this.actionsContainer.parentElement!==this.portalContainer&&this.portalContainer.append(this.actionsContainer);let i=Ox(t),a=i&&t.tableNode.child(0).childCount>1,o=t.rowIndex>0,s=t.rowIndex>0,c=t.tableNode.childCount>0?t.tableNode.child(0):null;this.currentColumnIndex=i?t.columnIndex:null,this.currentColumnAlignment=this.resolveColumnAlignment(this.currentColumnIndex===null?null:c?.maybeChild(this.currentColumnIndex)?.attrs?.alignment),this.updateAlignmentButtonsState(i),this.renderMoreActions(o,i,s,a),this.currentTableElement=r,this.currentTableStart=t.tableStart,this.currentTableNodeSize=t.tableNodeSize,this.hasPositionContext=!0,this.updateOverlayPosition(),this.repositionScheduler.schedule()}detach(){this.moreActionsRoot.render(null),this.actionsContainer.remove(),this.currentTableElement=null,this.currentTableStart=null,this.currentTableNodeSize=null,this.currentColumnIndex=null,this.currentColumnAlignment=Gx,this.updateAlignmentButtonsState(!1),this.hasPositionContext=!1}destroy(){this.detach(),this.repositionScheduler.destroy(),this.moreActionsRoot.unmount(),this.actionsContainer.removeEventListener(`mousedown`,this.handleActionsMouseDown),this.deleteButton.removeEventListener(`click`,this.handleDeleteClick),this.alignLeftButton.removeEventListener(`click`,this.handleAlignLeftClick),this.alignCenterButton.removeEventListener(`click`,this.handleAlignCenterClick),this.alignRightButton.removeEventListener(`click`,this.handleAlignRightClick)}},$x=(e,n)=>{let i=cn(void 0,n);return r.u(()=>new t.i({key:new t.a(zx),view:t=>new Qx(t,i,e)}))},eS=`list_item`,tS=`li[data-item-type="task"]`,nS=24,rS=(e,t)=>{let n=t.getBoundingClientRect();return e.clientX>=n.left&&e.clientX<=n.left+nS&&e.clientY>=n.top&&e.clientY<=n.top+nS},iS=e=>{if(!(e instanceof Element))return null;let t=e.closest(tS);return t instanceof HTMLElement?t:null},aS=(e,t)=>{if(!e.editable)return!1;let n=iS(t.target);return!n||!rS(t,n)?!1:(t.preventDefault(),!0)},oS=(e,t)=>{let n=e.posAtDOM(t,0)-1,r=e.state.doc.nodeAt(n);return!r||r.type.name!==eS||r.attrs.checked==null?!1:(e.dispatch(e.state.tr.setNodeMarkup(n,void 0,{...r.attrs,checked:!r.attrs.checked})),!0)},sS=r.u(()=>new t.i({props:{handleDOMEvents:{mousedown:(e,t)=>aS(e,t),dblclick:(e,t)=>aS(e,t),click:(e,t)=>{if(!e.editable)return!1;let n=iS(t.target);return!n||!rS(t,n)||!oS(e,n)?!1:(t.preventDefault(),!0)}}}})),cS=`Tab`,lS=4,uS=/^ */,dS=`list_item`,fS=e=>typeof e.props.editable==`function`?e.props.editable(e.state):e.editable,pS=e=>{let{$from:t}=e.selection;for(let e=t.depth;e>=0;--e){let n=t.node(e);if(n.type.name===dS)return n.type}return null},mS=e=>{let{selection:t,doc:n}=e;if(t.empty)return[t.$from.start()];let r=new Set;return n.nodesBetween(t.from,t.to,(e,t)=>{e.isTextblock&&r.add(t+1)}),Array.from(r)},hS=(e,t)=>{let{state:n}=e,r=` `.repeat(lS),i=mS(n).sort((e,t)=>t-e),a=n.tr;return n.selection.empty?a.insertText(r,n.selection.to):i.forEach(e=>{a.insertText(r,e)}),a.docChanged?(t.preventDefault(),e.dispatch(a),!0):!1},gS=(e,n)=>{let{state:r}=e,{selection:i}=r;if(!(i instanceof t.c))return!1;let a=mS(r).sort((e,t)=>t-e),o=r.tr;return a.forEach(e=>{let t=r.doc.resolve(e).parent.textContent.match(uS)?.[0].length??0,n=Math.min(t,lS);n<=0||o.delete(e,e+n)}),o.docChanged?(n.preventDefault(),e.dispatch(o),!0):!1},_S=r.u(()=>new t.i({key:new t.a(`zt-md-tab-space-indent`),props:{handleKeyDown:(e,t)=>{let n=e;if(!fS(n)||t.defaultPrevented||t.key!==cS||t.altKey||t.ctrlKey||t.metaKey)return!1;let r=pS(n.state);if(r){let e=(t.shiftKey?i.n(r):i.r(r))(n.state,n.dispatch);return t.preventDefault(),e||!0}return t.shiftKey?gS(n,t):hS(n,t)}}})),vS=async e=>{let t=await Promise.resolve().then(()=>require("./lib-BLTQkf4j.cjs")).then(e=>e._),n=await Promise.resolve().then(()=>require("./lib-D7VWCO2M.cjs")),r=await Promise.resolve().then(()=>require("./lib-C82poHMJ.cjs")),i=await Promise.resolve().then(()=>require("./lib-C61-3fwS.cjs")),a=await Promise.resolve().then(()=>require("./lib-DrllUeuK.cjs")),o=await Promise.resolve().then(()=>require("./lib-CHQUpMrL.cjs")).then(e=>e.n),s=await Promise.resolve().then(()=>require("./lib-BzlEyehQ.cjs")),c=await Promise.resolve().then(()=>require("./lib-CqJFV3ME.cjs")).then(e=>e.m),l=C(t,`Editor`),u=C(t,`rootCtx`),d=C(t,`defaultValueCtx`),f=C(t,`editorViewOptionsCtx`),p=C(t,`nodeViewCtx`),m=C(i,`listenerCtx`),h=C(i,`listener`),g=C(a,`history`),_=C(n,`clipboard`),v=C(r,`indent`),y=C(r,`indentConfig`),x=C(o,`commonmark`),w=C(s,`gfm`),T=C(c,`replaceAll`),E=e.messages??cn(),ee=$x(e.portalContainer,E),D=Rb(e.portalContainer,E),ne=Jy(E,e.portalContainer),re=og(E,e.portalContainer),ie=await fx(e.portalContainer,e.slashMenu,E,e.imageUpload,e.locale),ae=ie.plugins,oe={listener:h,commonmark:x,gfm:w,history:g,codeBlockPrism:sb,codeBlockLanguagePicker:ne,clipboard:_,indent:v,imageDeleteSelection:Jn,tableArrowEntry:bx,mathBackspaceEntry:Pl,blockquoteBackspaceLift:r_,tableFocusActions:ee,selectionTooltip:D,gapCursor:de,dropCursor:te,math:Xg,mathInlineEdit:re,mathInlineArrowNavigation:Og,taskListToggle:sS,tabSpaceIndent:_S,codeBlockModASelect:tb,slash:ae.length>0?ae:null},se=S(oe,{includeRuntime:!1}),O=S(oe,{includeRuntime:!0}).filter(e=>e.name===`clipboard`||e.name===`indent`),ce=l.make();ce.config(t=>{En(t),t.set(u,e.root),t.set(d,e.markdown),t.set(f,{editable:()=>!e.readOnly,handleClick:(e,t,n)=>{let r=n.target;if(!(r instanceof Element))return!1;let i=r.closest(`a[href]`);if(!(i instanceof HTMLAnchorElement))return!1;let a=mn(i.getAttribute(`href`));return!a||!n.ctrlKey?!1:(n.preventDefault(),n.stopPropagation(),window.open(a,`_blank`,`noopener,noreferrer`),!0)}});let n=t.get(p)??[];t.set(p,[...n,[`image`,Fn(E)],[`math_block`,Qh(E)],[`math_inline`,fg(E)],[`code_block`,p_(E)]]),t.get(m).markdownUpdated((t,n)=>{e.onChange(n)}),ie.config&&ie.config(t)}),se.forEach(e=>{ce.use(e.plugin)}),await ce.create(),O.forEach(e=>{try{ce.use(e.plugin),e.name===`indent`&&ce.action(e=>{e.set(y,{type:`space`,size:4})})}catch(e){console.error(e)}});let le=b(T,ce);return{destroy:async()=>{await ce.destroy()},setMarkdown:async e=>{le(e)},setEditable:async e=>{}}},yS=e=>{let t=(0,u.useRef)(null),n=(0,u.useRef)(e.markdown),r=(0,u.useRef)(e.markdown),i=(0,u.useRef)(e.messages),a=(0,u.useRef)(e.locale),o=(0,u.useRef)(e.slashMenu),s=(0,u.useRef)(e.imageUpload),c=(0,u.useRef)(e.onMarkdownChange),l=(0,u.useRef)(e.onInitError),d=(0,u.useRef)(e.onInitReady),f=(0,u.useRef)(null);(0,u.useEffect)(()=>{r.current=e.markdown},[e.markdown]),(0,u.useEffect)(()=>{i.current=e.messages},[e.messages]),(0,u.useEffect)(()=>{a.current=e.locale},[e.locale]),(0,u.useEffect)(()=>{o.current=e.slashMenu},[e.slashMenu]),(0,u.useEffect)(()=>{s.current=e.imageUpload},[e.imageUpload]),(0,u.useEffect)(()=>{c.current=e.onMarkdownChange},[e.onMarkdownChange]),(0,u.useEffect)(()=>{l.current=e.onInitError},[e.onInitError]),(0,u.useEffect)(()=>{d.current=e.onInitReady},[e.onInitReady]),(0,u.useEffect)(()=>(f.current&&f.current.cancel(),f.current=y(e=>{c.current(e)},e.debounceMs),()=>{f.current?.cancel(),f.current=null}),[e.debounceMs]),(0,u.useEffect)(()=>{let c=e.root;if(!c)return;let u=!1,p=null;return(async()=>{try{let l=await vS({root:c,portalContainer:e.portalContainer,markdown:r.current,readOnly:e.readOnly,messages:i.current,locale:a.current,slashMenu:o.current,imageUpload:s.current,onChange:e=>{n.current=e,f.current?.(e)}});if(u){await l.destroy();return}p=l,t.current=l,d.current?.()}catch(e){u||(console.error(`Milkdown init failed:`,e),l.current?.(e))}})(),()=>{u=!0,f.current?.cancel(),p&&=(p.destroy(),t.current===p&&(t.current=null),null)}},[e.root,e.readOnly,e.portalContainer,e.locale]),(0,u.useEffect)(()=>{let r=t.current;r&&e.markdown!==n.current&&(n.current=e.markdown,r.setMarkdown(e.markdown))},[e.markdown])},bS=160,xS=e=>e.length===0?`""`:`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`).replace(/\r\n|\r|\n/g,`\\A `)}"`,SS=e=>(yS({root:e.root,markdown:e.markdown,portalContainer:e.portalContainer,readOnly:e.readOnly,debounceMs:e.debounceMs,messages:e.messages,locale:e.locale,slashMenu:e.slashMenu,imageUpload:e.imageUpload,onMarkdownChange:e.onMarkdownChange,onInitReady:e.onInitReady,onInitError:e.onInitError}),(0,m.jsx)(`div`,{className:g(`zt-md-editor`,e.readOnly?`zt-md-readonly`:`zt-md-editable`),"aria-label":e.messages.editorAriaLabel,style:e.editorStyle,children:(0,m.jsx)(`div`,{"data-milkdown-root":!0,ref:e.onRootRef})})),CS=e=>{let[t,n]=(0,u.useState)(``),[r,i]=(0,u.useState)(null),[a,o]=(0,u.useState)(null),s=e.theme??`light`,c=e.readOnly??!1,l=e.debounceMs??bS,{markdown:d,setMarkdown:f}=v(e.value,e.defaultValue,e.onChange),p=(0,u.useMemo)(()=>cn(e.locale,e.messages,e.placeholder),[e.locale,e.messages,e.placeholder]),h={"--zt-gap-placeholder-content":xS(p.placeholder),...e.maxHeight===void 0?{}:{maxHeight:e.maxHeight,overflowY:`auto`}},_=(0,u.useCallback)(e=>{f(e)},[f]),y=(0,u.useCallback)(()=>{n(``)},[]),b=(0,u.useCallback)(e=>{n(e instanceof Error?e.message:p.initError)},[p.initError]),x=(0,u.useCallback)(e=>{i(e)},[]),S=(0,u.useCallback)(e=>{o(e)},[]);return(0,m.jsxs)(`div`,{className:g(`zt-md`,s===`dark`?`zt-md-dark`:`zt-md-light`,e.className),children:[e.headerSlot?(0,m.jsx)(`div`,{className:`zt-md-header`,children:e.headerSlot}):null,(0,m.jsxs)(`div`,{className:`zt-md-body`,children:[t?(0,m.jsx)(`div`,{className:`zt-md-error`,children:t}):null,r?(0,m.jsx)(SS,{root:a,onRootRef:S,markdown:d,locale:e.locale,portalContainer:r,readOnly:c,debounceMs:l,messages:p,slashMenu:e.slashMenu,imageUpload:e.imageUpload,editorStyle:h,onMarkdownChange:_,onInitReady:y,onInitError:b}):null,(0,m.jsx)(`div`,{ref:x,className:`zt-md-portal`})]})]})};exports.MilkdownEditor=CS;
|
|
365
|
+
`).lastIndexOf(`/`);if(a<0)return!1;let o=r+a,s=t.tr.delete(o,i);return e.dispatch(s.scrollIntoView()),!0},eY={Type:eD,Heading1:DE,Heading2:OE,Heading3:kE,Heading4:AE,Heading5:ME,Heading6:jE,Image:FE,List:VE,ListOrdered:zE,ListTodo:BE,Code:wE,SquareFunction:KE,SquareCode:GE,TextQuote:QE,Sigma:WE,Table:JE},tY=SE,nY=(e,t,n,r)=>{r.splice(0).forEach(e=>{e.unmount()}),e.innerHTML=``;let i=``;t.forEach((t,a)=>{if(t.group!==i){let n=document.createElement(`div`);n.className=`slash-menu-group`,n.textContent=t.group,e.appendChild(n),i=t.group}let o=document.createElement(`div`);o.className=`slash-menu-item`,o.dataset.command=t.command,o.dataset.selected=a===n?`true`:`false`;let s=document.createElement(`span`);s.className=`slash-menu-item-icon`;let c=t.icon?eY[t.icon]??tY:null;if(c){let e=(0,p.createRoot)(s);e.render((0,d.createElement)(c,{size:16,strokeWidth:2})),r.push(e)}let l=document.createElement(`span`);l.className=`slash-menu-item-label`,l.textContent=t.label,o.appendChild(s),o.appendChild(l),e.appendChild(o)})},rY=e=>{let t=document.createElement(`div`);t.className=`slash-menu`,t.style.display=`none`,e.appendChild(t);let n=!1,r=``,i=!1,a=null,o=[],s=()=>{if(!n||!a)return;let{editorWrapper:r,anchorTopInContent:i,anchorBottomInContent:o,anchorLeftInContent:s,placement:c,offsetY:l}=a,u=kq({wrapper:r,anchor:{anchorTopInContent:i,anchorBottomInContent:o,anchorLeftInContent:s},overlaySize:{width:t.offsetWidth||210},placement:c,offsetY:l,boundaryInset:4},e);t.style.left=`${u.left}px`,t.style.top=`${u.top}px`,t.dataset.placement=c},c=Aq(()=>{n&&s()}),l=()=>{t.style.top=``,t.style.left=``,t.style.transform=``,delete t.dataset.placement};return{menu:t,isVisible:()=>n,setVisible:(e,a)=>{if(n!==e){if(n=e,t.style.display=e?`block`:`none`,!e){c.unbindGlobal(),c.bindWrapper(null),l(),r=``,i=!0;return}c.bindGlobal(),a&&(a(),i&&=(a(),!1))}},renderIfNeeded:(e,n)=>{let i=`${e.map(e=>e.command).join(`|`)}::${n}`;r!==i&&(nY(t,e,n,o),r=i)},scrollActiveItemIntoView:e=>{let n=t.querySelector(`.slash-menu-item[data-selected="true"]`);n&&(n.scrollIntoView({block:`nearest`,inline:`nearest`}),e&&e())},updatePositionContext:e=>{a=e,c.bindWrapper(e?.editorWrapper??null)},updatePosition:s,destroy:()=>{o.splice(0).forEach(e=>{e.unmount()}),c.destroy(),t.remove()}}};function iY(e){let t=Vg({},`${e}_SLASH_SPEC`),n=zg(n=>{let r=n.get(t.key);return new $c({key:new nl(`${e}_SLASH`),...r})}),r=[t,n];return r.key=t.key,r.pluginKey=n.key,t.meta={package:`@milkdown/plugin-slash`,displayName:`Ctx<slashSpec>|${e}`},n.meta={package:`@milkdown/plugin-slash`,displayName:`Prose<slash>|${e}`},r}var aY=(e,t)=>{if(!(!e||typeof e!=`object`))return e[t]},oY=()=>{if(typeof iY!=`function`)return console.error(`[zt-md/slash] slashFactory not found`),null;let e=iY(`zt-md-slash`),t=Array.isArray(e)?e[0]:void 0,n=Array.isArray(e)?e[1]:e,r=Array.isArray(e)?e[2]:void 0;if(!n)return null;let i=Array.isArray(e)?e.filter((e,t)=>t<2&&e!=null):[n],a=aY(t,`key`)??aY(n,`key`)??aY(r,`key`)??aY(e,`key`);return i.length===0||a===void 0?null:{plugins:i,key:a}},sY=(e,t,n,r,i=`zh-CN`)=>{if(t?.enabled===!1)return{plugins:[],config:null};try{let a=oY();if(!a)return{plugins:[],config:null};let o=qJ(t,i),s=rY(e),c=0,l=null,u=o,d=!1,f=new Set([`ArrowDown`,`ArrowUp`,`Enter`,`Escape`]),p=e=>!f.has(e.key)||!d?!1:e.key===`ArrowDown`?(e.preventDefault(),u.length===0?!0:(c=(c+1)%u.length,s.renderIfNeeded(u,c),s.scrollActiveItemIntoView(()=>{s.updatePosition()}),!0)):e.key===`ArrowUp`?(e.preventDefault(),u.length===0?!0:(c=(c-1+u.length)%u.length,s.renderIfNeeded(u,c),s.scrollActiveItemIntoView(()=>{s.updatePosition()}),!0)):e.key===`Enter`?(e.preventDefault(),g(),!0):e.key===`Escape`?(e.preventDefault(),s.setVisible(!1),!0):!1,m=e=>{let t=e?.state?.selection?.from;if(typeof t!=`number`)return null;let n=e?.coordsAtPos?.(t);return n?new DOMRect(n.left,n.top,Math.max(n.right-n.left,1),n.bottom-n.top):null},h=e=>{if(!WJ(e)){u=[],d=!1,s.updatePositionContext(null),s.setVisible(!1);return}let t=QJ(e,o);if(u=t.visibleItems,d=t.shouldShow,t.shouldShow&&c>=u.length&&(c=0),t.shouldShow&&!s.isVisible()&&(c=0),!t.shouldShow){s.updatePositionContext(null),s.setVisible(!1);return}let n=m(e),r=Tq(e?.dom);if(n&&r){let e=Eq(n,320),t=Dq(n,r);s.updatePositionContext({editorWrapper:r,anchorTopInContent:t.anchorTopInContent,anchorBottomInContent:t.anchorBottomInContent,anchorLeftInContent:t.anchorLeftInContent,placement:e,offsetY:8})}s.renderIfNeeded(u,c),s.isVisible()?s.updatePosition():s.setVisible(!0,()=>{s.updatePosition()})},g=async()=>{if(!WJ(l)){d=!1,s.updatePositionContext(null),s.setVisible(!1);return}if(!l||c<0||c>=u.length)return;let t=u[c];if($J(l)){if(t.command===`image`){s.setVisible(!1),n&&CL({portalContainer:e,view:l,messages:n,imageUpload:r});return}await UJ(l,t.command)&&(s.setVisible(!1),t.command===`mathBlock`&&queueMicrotask(()=>{let e=l?.dom?.querySelector?.(`.zt-md-math-block-editing .zt-md-math-block-textarea`);!e||document.activeElement===e||e.focus()}))}};return s.menu.addEventListener(`mousedown`,e=>{e.preventDefault();let t=(e.target?.closest(`.slash-menu-item`))?.dataset.command??``;if(!t)return;let n=u.findIndex(e=>e.command===t);n<0||(c=n,g())}),{plugins:a.plugins,config:e=>{e.set(a.key,{props:{handleKeyDown:(e,t)=>p(t)},view:()=>({update:e=>{l=e,h(e)},destroy:()=>{d=!1,s.destroy()}})})}}}catch(e){return console.error(`[zt-md/slash] init failed`,e),{plugins:[],config:null}}},cY=`table`,lY=`ArrowUp`,uY=e=>e.key!==lY||e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey,dY=(e,t)=>{let n=t.nodeBefore;return!n||n.type.name!==cY?null:{tableNode:n,tableStart:e-n.nodeSize}},fY=e=>{if(e.parent.type.name!==`paragraph`||e.parentOffset!==0||e.parent.childCount>0||e.depth<1)return null;let t=e.index(e.depth-1);if(t<=0)return null;let n=e.node(e.depth-1).child(t-1);return n.type.name===cY?{tableNode:n,tableStart:e.before(e.depth)-n.nodeSize}:null},pY=(e,t)=>{if(e.childCount===0)return null;let n=e.childCount-1,r=e.child(n);if(r.childCount===0)return null;let i=0;for(let t=0;t<n;t+=1)i+=e.child(t).nodeSize;let a=r.childCount-1,o=r.child(a),s=0;for(let e=0;e<a;e+=1)s+=r.child(e).nodeSize;return t+1+i+1+s+o.nodeSize-1},mY=e=>{let{selection:t}=e.state,n=t.$from,r=null;if(t instanceof XT?r=dY(t.from,n):t.empty&&(r=fY(n)),!r)return!1;let i=pY(r.tableNode,r.tableStart);if(i===null)return!1;let a=e.state.tr.setSelection(M.near(e.state.doc.resolve(i),-1)).scrollIntoView();return e.dispatch(a),e.focus(),!0},hY=zg(()=>new $c({key:new nl(`zt-md-table-arrow-entry`),props:{handleKeyDown:(e,t)=>uY(t)?!1:mY(e)}})),gY=`table`,_Y=`table_header_row`,vY=`table_row`,yY=`table_header`,bY=`table_cell`,xY=e=>{let t=e.selection.$from,n=-1,r=-1;for(let e=t.depth;e>=0;--e){let i=t.node(e);if(r<0&&(i.type.name===bY||i.type.name===yY)&&(r=t.index(e-1)),n<0&&(i.type.name===vY||i.type.name===_Y)&&(n=t.index(e-1)),i.type.name===gY)return{tableNode:i,tableStart:e===0?0:t.before(e),tableNodeSize:i.nodeSize,rowIndex:n,columnIndex:r}}return null},SY=(e,t,n,r)=>{if(n<0||n>=e.childCount)return null;let i=0;for(let t=0;t<n;t+=1)i+=e.child(t).nodeSize;let a=e.child(n);if(r<0||r>=a.childCount)return null;let o=0;for(let e=0;e<r;e+=1)o+=a.child(e).nodeSize;return t+1+i+1+o+1+1},CY=e=>{if(e.columnIndex<0||e.tableNode.childCount===0)return!1;let t=e.tableNode.child(0);return e.columnIndex<t.childCount},wY=(e,t,n,r)=>{let i=SY(t.tableNode,t.tableStart,n,r);if(i===null)return!1;let a=e.state.tr.setSelection(M.near(e.state.tr.doc.resolve(i),1));return e.dispatch(a),!0},TY=(e,t)=>t(e.state,e.dispatch,e)?(e.dispatch(e.state.tr.scrollIntoView()),e.focus(),!0):!1,EY=(e,t,n)=>t.rowIndex<0||t.columnIndex<0||!wY(e,t,t.rowIndex,t.columnIndex)?!1:TY(e,n===`above`?Dx:Ox),DY=(e,t)=>t.rowIndex<=0||t.columnIndex<0||!wY(e,t,t.rowIndex,t.columnIndex)?!1:TY(e,Ax),OY=(e,t,n)=>t.rowIndex<0||t.columnIndex<0||!wY(e,t,t.rowIndex,t.columnIndex)?!1:TY(e,n===`left`?xx:Sx),kY=(e,t)=>t.rowIndex<0||t.columnIndex<0||(t.tableNode.childCount>0?t.tableNode.child(0).childCount:0)<=1||!wY(e,t,t.rowIndex,t.columnIndex)?!1:TY(e,wx),AY=(e,t,n)=>{if(t.columnIndex<0)return!1;let r=Db.get(t.tableNode),i=t.tableStart+1,a=t.columnIndex,o=e.state.tr;for(let e=0;e<r.height;e+=1){let t=e*r.width+a,s=r.map[t];if(typeof s!=`number`)continue;let c=i+s,l=o.doc.nodeAt(c);if(!l)continue;let u={...l.attrs,alignment:n};o.setNodeMarkup(c,l.type,u,l.marks)}return o.docChanged?(o.scrollIntoView(),e.dispatch(o),e.focus(),!0):!1},jY=e=>{let t=xY(e.state);!t||t.rowIndex<=0||DY(e,t)},MY=e=>{let t=xY(e.state);!t||t.rowIndex<0||t.columnIndex<0||kY(e,t)},NY=e=>{let[t,n]=(0,d.useState)(!1),r=e=>{e.preventDefault()},i=e=>{n(e)},a=e=>{e.preventDefault()};return(0,d.createElement)(hq,{open:t,onOpenChange:i},(0,d.createElement)(gq,{asChild:!0},(0,d.createElement)(`button`,{type:`button`,className:`zt-md-table-action-button`,"aria-label":e.messages.tableMoreAriaLabel,onMouseDown:r},(0,d.createElement)(EE,{size:14,strokeWidth:2,"aria-hidden":`true`}))),(0,d.createElement)(_q,{align:`end`,sideOffset:6,className:`zt-md-table-action-popover`,container:e.portalContainer,collisionBoundary:e.collisionBoundary,hideWhenDetached:!0,onOpenAutoFocus:a,onCloseAutoFocus:a},(0,d.createElement)(`div`,{className:`zt-md-table-action-menu-group`},(0,d.createElement)(eL,{type:`button`,variant:`ghost`,size:`sm`,className:`zt-md-table-action-menu-item disabled:pointer-events-auto disabled:cursor-not-allowed`,disabled:!e.canInsertRowAbove,onMouseDown:r,onClick:()=>{e.onInsertRowAbove(),n(!1)}},e.messages.tableInsertRowAboveLabel),(0,d.createElement)(eL,{type:`button`,variant:`ghost`,size:`sm`,className:`zt-md-table-action-menu-item disabled:pointer-events-auto disabled:cursor-not-allowed`,onMouseDown:r,onClick:()=>{e.onInsertRowBelow(),n(!1)}},e.messages.tableInsertRowBelowLabel),(0,d.createElement)(eL,{type:`button`,variant:`ghost`,size:`sm`,className:`zt-md-table-action-menu-item disabled:pointer-events-auto disabled:cursor-not-allowed`,disabled:!e.canInsertColumn,onMouseDown:r,onClick:()=>{e.onInsertColumnLeft(),n(!1)}},e.messages.tableInsertColumnLeftLabel),(0,d.createElement)(eL,{type:`button`,variant:`ghost`,size:`sm`,className:`zt-md-table-action-menu-item disabled:pointer-events-auto disabled:cursor-not-allowed`,disabled:!e.canInsertColumn,onMouseDown:r,onClick:()=>{e.onInsertColumnRight(),n(!1)}},e.messages.tableInsertColumnRightLabel)),(0,d.createElement)(`div`,{className:`zt-md-table-action-menu-divider`,"aria-hidden":`true`}),(0,d.createElement)(`div`,{className:`zt-md-table-action-menu-group`},(0,d.createElement)(eL,{type:`button`,variant:`ghost`,size:`sm`,className:`zt-md-table-action-menu-item zt-md-table-action-menu-item-danger disabled:pointer-events-auto disabled:cursor-not-allowed`,disabled:!e.canDeleteRow,onMouseDown:r,onClick:()=>{e.onDeleteRow(),n(!1)}},e.messages.tableDeleteRowLabel),(0,d.createElement)(eL,{type:`button`,variant:`ghost`,size:`sm`,className:`zt-md-table-action-menu-item zt-md-table-action-menu-item-danger disabled:pointer-events-auto disabled:cursor-not-allowed`,disabled:!e.canDeleteColumn,onMouseDown:r,onClick:()=>{e.onDeleteColumn(),n(!1)}},e.messages.tableDeleteColumnLabel))))},PY=`zt-md-table-focus-actions`,FY=0,IY=24,LY=4,RY=4,zY=`top`,BY=`left`,VY=e=>(0,f.renderToStaticMarkup)((0,d.createElement)(e,{size:14,strokeWidth:2,"aria-hidden":`true`})),HY=VY($E),UY=VY(ZE),WY=VY(XE),GY=VY(YE),KY=e=>typeof e.props.editable==`function`?e.props.editable(e.state):e.editable,qY=class{constructor(e,t,n){this.currentTableStart=null,this.currentTableNodeSize=null,this.currentColumnIndex=null,this.currentColumnAlignment=BY,this.currentTableElement=null,this.hasPositionContext=!1,this.repositionScheduler=Aq(()=>{this.hasPositionContext&&this.updateOverlayPosition()}),this.handleActionsMouseDown=e=>{e.preventDefault()},this.handleDeleteClick=e=>{if(e.preventDefault(),this.currentTableStart===null||this.currentTableNodeSize===null)return;let t=this.currentTableStart,n=this.currentTableStart+this.currentTableNodeSize,r=this.view.state.tr.delete(t,n).scrollIntoView();this.view.dispatch(r),this.view.focus()},this.handleAlignLeftClick=()=>{this.applyColumnAlignment(`left`)},this.handleAlignCenterClick=()=>{this.applyColumnAlignment(`center`)},this.handleAlignRightClick=()=>{this.applyColumnAlignment(`right`)},this.handleInsertRowBelow=()=>{let e=xY(this.view.state);!e||e.rowIndex<0||EY(this.view,e,`below`)},this.handleInsertRowAbove=()=>{let e=xY(this.view.state);!e||e.rowIndex<=0||EY(this.view,e,`above`)},this.handleInsertColumnLeft=()=>{this.insertColumn(`left`)},this.handleInsertColumnRight=()=>{this.insertColumn(`right`)},this.handleDeleteRow=()=>{jY(this.view)},this.handleDeleteColumn=()=>{MY(this.view)},this.view=e,this.messages=t,this.portalContainer=n,this.editorWrapper=Tq(e.dom),this.actionsContainer=document.createElement(`div`),this.actionsContainer.className=`zt-md-table-actions-overlay`,this.deleteButton=document.createElement(`button`),this.deleteButton.type=`button`,this.deleteButton.className=`zt-md-table-action-button zt-md-table-action-button-danger`,this.deleteButton.style.display=`inline-flex`,this.deleteButton.setAttribute(`aria-label`,t.tableDeleteAriaLabel),this.deleteButton.innerHTML=HY,this.alignLeftButton=this.createColumnAlignmentButton(t.tableAlignLeftAriaLabel,UY),this.alignCenterButton=this.createColumnAlignmentButton(t.tableAlignCenterAriaLabel,WY),this.alignRightButton=this.createColumnAlignmentButton(t.tableAlignRightAriaLabel,GY),this.moreActionsMount=document.createElement(`span`),this.moreActionsMount.className=`zt-md-table-more-actions-mount`,this.moreActionsRoot=(0,p.createRoot)(this.moreActionsMount),this.actionsContainer.append(this.moreActionsMount,this.alignLeftButton,this.alignCenterButton,this.alignRightButton,this.deleteButton),this.actionsContainer.addEventListener(`mousedown`,this.handleActionsMouseDown),this.deleteButton.addEventListener(`click`,this.handleDeleteClick),this.alignLeftButton.addEventListener(`click`,this.handleAlignLeftClick),this.alignCenterButton.addEventListener(`click`,this.handleAlignCenterClick),this.alignRightButton.addEventListener(`click`,this.handleAlignRightClick),this.repositionScheduler.bindGlobal(),this.repositionScheduler.bindWrapper(this.editorWrapper),this.update(e)}createColumnAlignmentButton(e,t){let n=document.createElement(`button`);return n.type=`button`,n.className=`zt-md-table-action-button`,n.style.display=`inline-flex`,n.setAttribute(`aria-label`,e),n.innerHTML=t,n}resolveColumnAlignment(e){return e===`center`||e===`right`?e:BY}updateAlignmentButtonsState(e){this.alignLeftButton.disabled=!e,this.alignCenterButton.disabled=!e,this.alignRightButton.disabled=!e,this.alignLeftButton.classList.toggle(`zt-md-table-action-button-active`,e&&this.currentColumnAlignment===`left`),this.alignCenterButton.classList.toggle(`zt-md-table-action-button-active`,e&&this.currentColumnAlignment===`center`),this.alignRightButton.classList.toggle(`zt-md-table-action-button-active`,e&&this.currentColumnAlignment===`right`)}applyColumnAlignment(e){let t=xY(this.view.state);!t||t.rowIndex<0||t.columnIndex<0||AY(this.view,t,e)}insertColumn(e){let t=xY(this.view.state);!t||t.rowIndex<0||t.columnIndex<0||OY(this.view,t,e)}renderMoreActions(e,t,n,r){this.moreActionsRoot.render((0,d.createElement)(NY,{messages:this.messages,portalContainer:this.portalContainer,collisionBoundary:this.editorWrapper,canInsertRowAbove:e,canInsertColumn:t,canDeleteRow:n,canDeleteColumn:r,onInsertRowAbove:this.handleInsertRowAbove,onInsertRowBelow:this.handleInsertRowBelow,onInsertColumnLeft:this.handleInsertColumnLeft,onInsertColumnRight:this.handleInsertColumnRight,onDeleteRow:this.handleDeleteRow,onDeleteColumn:this.handleDeleteColumn}))}resolveTableElement(e){if(e instanceof HTMLTableElement)return e;let t=e.querySelector(`table`);return t instanceof HTMLTableElement?t:null}resolveTableAnchor(e,t){if(!this.editorWrapper)return null;let n=e.getBoundingClientRect(),r=Dq(n,this.editorWrapper),i=n.width,a=r.anchorLeftInContent+i-t-FY,o=r.anchorTopInContent-IY+LY;return{anchorLeftInContent:a,anchorTopInContent:o,anchorBottomInContent:o}}resolveActionsContainerWidth(){let e=this.actionsContainer.getBoundingClientRect().width;return e<=0?null:e}updateOverlayPosition(){if(!this.editorWrapper||!this.currentTableElement||this.actionsContainer.parentElement!==this.portalContainer)return;let e=this.resolveActionsContainerWidth();if(e===null)return;let t=this.resolveTableAnchor(this.currentTableElement,e);if(!t)return;let n=kq({wrapper:this.editorWrapper,anchor:t,overlaySize:{width:e},placement:zY,offsetY:0,boundaryInset:RY},this.portalContainer);this.actionsContainer.style.left=`${n.left}px`,this.actionsContainer.style.top=`${n.top}px`}update(e){if(this.view=e,!this.editorWrapper||!KY(e)){this.detach();return}let t=xY(e.state);if(!t){this.detach();return}let n=e.nodeDOM(t.tableStart);if(!(n instanceof HTMLElement)){this.detach();return}let r=this.resolveTableElement(n);if(!r){this.detach();return}this.actionsContainer.parentElement!==this.portalContainer&&this.portalContainer.append(this.actionsContainer);let i=CY(t),a=i&&t.tableNode.child(0).childCount>1,o=t.rowIndex>0,s=t.rowIndex>0,c=t.tableNode.childCount>0?t.tableNode.child(0):null;this.currentColumnIndex=i?t.columnIndex:null,this.currentColumnAlignment=this.resolveColumnAlignment(this.currentColumnIndex===null?null:c?.maybeChild(this.currentColumnIndex)?.attrs?.alignment),this.updateAlignmentButtonsState(i),this.renderMoreActions(o,i,s,a),this.currentTableElement=r,this.currentTableStart=t.tableStart,this.currentTableNodeSize=t.tableNodeSize,this.hasPositionContext=!0,this.updateOverlayPosition(),this.repositionScheduler.schedule()}detach(){this.moreActionsRoot.render(null),this.actionsContainer.remove(),this.currentTableElement=null,this.currentTableStart=null,this.currentTableNodeSize=null,this.currentColumnIndex=null,this.currentColumnAlignment=BY,this.updateAlignmentButtonsState(!1),this.hasPositionContext=!1}destroy(){this.detach(),this.repositionScheduler.destroy(),this.moreActionsRoot.unmount(),this.actionsContainer.removeEventListener(`mousedown`,this.handleActionsMouseDown),this.deleteButton.removeEventListener(`click`,this.handleDeleteClick),this.alignLeftButton.removeEventListener(`click`,this.handleAlignLeftClick),this.alignCenterButton.removeEventListener(`click`,this.handleAlignCenterClick),this.alignRightButton.removeEventListener(`click`,this.handleAlignRightClick)}},JY=(e,t)=>{let n=aO(void 0,t);return zg(()=>new $c({key:new nl(PY),view:t=>new qY(t,n,e)}))},YY=`list_item`,XY=`li[data-item-type="task"]`,ZY=24,QY=(e,t)=>{let n=t.getBoundingClientRect();return e.clientX>=n.left&&e.clientX<=n.left+ZY&&e.clientY>=n.top&&e.clientY<=n.top+ZY},$Y=e=>{if(!(e instanceof Element))return null;let t=e.closest(XY);return t instanceof HTMLElement?t:null},eX=(e,t)=>{if(!e.editable)return!1;let n=$Y(t.target);return!n||!QY(t,n)?!1:(t.preventDefault(),!0)},tX=(e,t)=>{let n=e.posAtDOM(t,0)-1,r=e.state.doc.nodeAt(n);return!r||r.type.name!==YY||r.attrs.checked==null?!1:(e.dispatch(e.state.tr.setNodeMarkup(n,void 0,{...r.attrs,checked:!r.attrs.checked})),!0)},nX=zg(()=>new $c({props:{handleDOMEvents:{mousedown:(e,t)=>eX(e,t),dblclick:(e,t)=>eX(e,t),click:(e,t)=>{if(!e.editable)return!1;let n=$Y(t.target);return!n||!QY(t,n)||!tX(e,n)?!1:(t.preventDefault(),!0)}}}})),rX=`Tab`,iX=4,aX=/^ */,oX=`list_item`,sX=e=>typeof e.props.editable==`function`?e.props.editable(e.state):e.editable,cX=e=>{let{$from:t}=e.selection;for(let e=t.depth;e>=0;--e){let n=t.node(e);if(n.type.name===oX)return n.type}return null},lX=e=>{let{selection:t,doc:n}=e;if(t.empty)return[t.$from.start()];let r=new Set;return n.nodesBetween(t.from,t.to,(e,t)=>{e.isTextblock&&r.add(t+1)}),Array.from(r)},uX=(e,t)=>{let{state:n}=e,r=` `.repeat(iX),i=lX(n).sort((e,t)=>t-e),a=n.tr;return n.selection.empty?a.insertText(r,n.selection.to):i.forEach(e=>{a.insertText(r,e)}),a.docChanged?(t.preventDefault(),e.dispatch(a),!0):!1},dX=(e,t)=>{let{state:n}=e,{selection:r}=n;if(!(r instanceof M))return!1;let i=lX(n).sort((e,t)=>t-e),a=n.tr;return i.forEach(e=>{let t=n.doc.resolve(e).parent.textContent.match(aX)?.[0].length??0,r=Math.min(t,iX);r<=0||a.delete(e,e+r)}),a.docChanged?(t.preventDefault(),e.dispatch(a),!0):!1},fX=zg(()=>new $c({key:new nl(`zt-md-tab-space-indent`),props:{handleKeyDown:(e,t)=>{let n=e;if(!sX(n)||t.defaultPrevented||t.key!==rX||t.altKey||t.ctrlKey||t.metaKey)return!1;let r=cX(n.state);if(r){let e=(t.shiftKey?wv(r):Dv(r))(n.state,n.dispatch);return t.preventDefault(),e||!0}return t.shiftKey?dX(n,t):uX(n,t)}}})),pX=e=>{let t=e.target;if(!(t instanceof Element))return null;let n=t.closest(`a[href]`);return n instanceof HTMLAnchorElement?n:null},mX=e=>e?.type.name===`image`,hX=(e,t)=>{let n=pX(e);if(!n)return!1;let r=dO(n.getAttribute(`href`));return!r||t||!e.ctrlKey?!1:(e.preventDefault(),e.stopPropagation(),window.open(r,`_blank`,`noopener,noreferrer`),!0)},gX=(e,t)=>!t||!pX(e)?!1:(e.preventDefault(),e.stopPropagation(),!0),_X=e=>{let t=e.messages??aO(),n=JY(e.contentPortalContainer,t),r=NJ(e.contentPortalContainer,t),i=Gq(t,e.contentPortalContainer),a=rW(t,e.contentPortalContainer),o=sY(e.portalContainer,e.slashMenu,t,e.imageUpload,e.locale),s=o.plugins,c={listener:yv,commonmark:wb,gfm:VT,history:k_,codeBlockPrism:iJ,codeBlockLanguagePicker:i,clipboard:Qg,indent:N_,imageDeleteSelection:GO,tableArrowEntry:hY,mathBackspaceEntry:kL,blockquoteBackspaceLift:eG,tableFocusActions:n,selectionTooltip:r,gapCursor:sE,dropCursor:YT,math:qW,mathInlineEdit:a,mathInlineArrowNavigation:TW,taskListToggle:nX,tabSpaceIndent:fX,codeBlockModASelect:Qq,slash:s.length>0?s:null},l=WT(c,{includeRuntime:!1}),u=WT(c,{includeRuntime:!0}).filter(e=>e.name===`clipboard`||e.name===`indent`),d=jg.make();d.config(n=>{CO(n),n.set(Cg,e.root),n.set(lg,e.markdown),n.set(Sg,{editable:()=>!e.readOnly,handleDOMEvents:{mousedown:(t,n)=>n instanceof MouseEvent?gX(n,e.readOnly):!1,click:(t,n)=>n instanceof MouseEvent?gX(n,e.readOnly):!1},handleClick:(t,n,r)=>hX(r,e.readOnly),handleClickOn:(t,n,r,i,a,o)=>hX(a,e.readOnly)?!0:e.readOnly&&o&&mX(r)?(a.preventDefault(),!0):!1});let r=n.get(Eh)??[];n.set(Eh,[...r,[`image`,MO(t)],[`math_block`,YU(t)],[`math_inline`,lW(t)],[`code_block`,uG(t)]]),n.get(_v).markdownUpdated((t,n)=>{e.onChange(n)}),o.config&&o.config(n)}),l.forEach(e=>{d.use(e.plugin)});let f=()=>{u.forEach(e=>{try{d.use(e.plugin),e.name===`indent`&&d.action(e=>{e.set(j_,{type:`space`,size:4})})}catch(e){console.error(e)}})},p=HT(Jg,d);return{editor:d,installRuntimePlugins:f,setMarkdown:e=>{p(e)}}},vX=(e,t,n,r)=>{let i=e,a=i.create.bind(e);return i.create=async()=>{try{let e=await a();return t(),n(),e}catch(e){throw console.error(`Milkdown init failed:`,e),r(e),e}},i},yX=e=>{let t=(0,d.useRef)(null),n=(0,d.useRef)(e.markdown),r=(0,d.useRef)(e.onMarkdownChange),i=(0,d.useRef)(e.onInitError),a=(0,d.useRef)(e.onInitReady),o=(0,d.useRef)(null),s=b(r=>{t.current=null,n.current=e.markdown;let s=_X({root:r,portalContainer:e.portalContainer,contentPortalContainer:e.contentPortalContainer,markdown:e.markdown,readOnly:e.readOnly,messages:e.messages,locale:e.locale,slashMenu:e.slashMenu,imageUpload:e.imageUpload,onChange:e=>{n.current=e,o.current?.(e)}});return vX(s.editor,s.installRuntimePlugins,()=>{t.current=s,a.current?.()},e=>{i.current?.(e)})},[e.portalContainer,e.contentPortalContainer,e.readOnly,e.locale]);(0,d.useEffect)(()=>{r.current=e.onMarkdownChange},[e.onMarkdownChange]),(0,d.useEffect)(()=>{i.current=e.onInitError},[e.onInitError]),(0,d.useEffect)(()=>{a.current=e.onInitReady},[e.onInitReady]),(0,d.useEffect)(()=>(o.current&&o.current.cancel(),o.current=T(e=>{r.current(e)},e.debounceMs),()=>{o.current?.cancel(),o.current=null}),[e.debounceMs]),(0,d.useEffect)(()=>()=>{t.current=null},[e.portalContainer,e.contentPortalContainer,e.readOnly,e.locale]),(0,d.useEffect)(()=>{let r=t.current;!r||s.loading||e.markdown!==n.current&&(n.current=e.markdown,r.setMarkdown(e.markdown))},[s.loading,e.markdown])},bX=160,xX=e=>e.length===0?`""`:`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`).replace(/\r\n|\r|\n/g,`\\A `)}"`,SX=e=>(yX({markdown:e.markdown,portalContainer:e.portalContainer,contentPortalContainer:e.contentPortalContainer,readOnly:e.readOnly,debounceMs:e.debounceMs,messages:e.messages,locale:e.locale,slashMenu:e.slashMenu,imageUpload:e.imageUpload,onMarkdownChange:e.onMarkdownChange,onInitReady:e.onInitReady,onInitError:e.onInitError}),(0,h.jsx)(v,{})),CX=e=>{let[t,n]=(0,d.useState)(``),[r,i]=(0,d.useState)(null),[a,o]=(0,d.useState)(null),s=e.theme??`light`,c=e.readOnly??!1,l=e.debounceMs??bX,{markdown:u,setMarkdown:f}=w(e.value,e.defaultValue,e.onChange),p=(0,d.useMemo)(()=>aO(e.locale,e.messages,e.placeholder),[e.locale,e.messages,e.placeholder]),m={"--zt-gap-placeholder-content":xX(p.placeholder),...e.maxHeight===void 0?{}:{maxHeight:e.maxHeight,overflowY:`auto`}},g=(0,d.useCallback)(e=>{f(e)},[f]),_=(0,d.useCallback)(()=>{n(``)},[]),v=(0,d.useCallback)(e=>{n(e instanceof Error?e.message:p.initError)},[p.initError]),b=(0,d.useCallback)(e=>{i(e)},[]),x=(0,d.useCallback)(e=>{o(e)},[]);return(0,h.jsxs)(`div`,{className:S(`zt-md`,s===`dark`?`zt-md-dark`:`zt-md-light`,e.className),children:[e.headerSlot?(0,h.jsx)(`div`,{className:`zt-md-header`,children:e.headerSlot}):null,(0,h.jsxs)(`div`,{className:`zt-md-body`,children:[t?(0,h.jsx)(`div`,{className:`zt-md-error`,children:t}):null,(0,h.jsxs)(`div`,{className:S(`zt-md-editor`,c?`zt-md-readonly`:`zt-md-editable`),"aria-label":p.editorAriaLabel,style:m,children:[r&&a?(0,h.jsx)(y,{children:(0,h.jsx)(SX,{markdown:u,locale:e.locale,portalContainer:r,contentPortalContainer:a,readOnly:c,debounceMs:l,messages:p,slashMenu:e.slashMenu,imageUpload:e.imageUpload,onMarkdownChange:g,onInitReady:_,onInitError:v})}):null,(0,h.jsx)(`div`,{ref:x,className:`zt-md-content-portal`})]}),(0,h.jsx)(`div`,{ref:b,className:`zt-md-portal`})]})]})};exports.MilkdownEditor=CX;
|